Proyectos de Subversion LeadersLinked - Services

Rev

Rev 333 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 333 Rev 334
Línea 523... Línea 523...
523
           
523
           
524
                    $target_filename    = 'user-' . uniqid() . '.png';
524
                    $target_filename    = 'user-' . uniqid() . '.png';
525
                    $source             = $files['image']['tmp_name'];
525
                    $source             = $files['image']['tmp_name'];
526
                    $unlink_source      = false;
526
                    $unlink_source      = false;
527
                    $crop_to_dimensions = true;
527
                    $crop_to_dimensions = true;
528
                    if(!$image->uploadImageChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
528
                    if(!$image->uploadProcessChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
529
                        return new JsonModel([
529
                        return new JsonModel([
530
                            'success'   => false,
530
                            'success'   => false,
531
                            'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
531
                            'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
532
                        ]);
532
                        ]);
Línea 542... Línea 542...
542
                        ]);
542
                        ]);
543
                    } else {
543
                    } else {
544
                        $unlink_source      = true;
544
                        $unlink_source      = true;
545
                        $target_filename    = 'user-profile-' . uniqid() . '.png';
545
                        $target_filename    = 'user-profile-' . uniqid() . '.png';
Línea 546... Línea 546...
546
                        
546
                        
547
                        if(!$image->uploadImageChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
547
                        if(!$image->uploadProcessChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
548
                            return new JsonModel([
548
                            return new JsonModel([
549
                                'success'   => false,
549
                                'success'   => false,
550
                                'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
550
                                'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
551
                            ]);
551
                            ]);