Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 17314 Rev 17315
Línea 928... Línea 928...
928
        // Generar nombres de archivo únicos
928
        // Generar nombres de archivo únicos
929
        $source = $storage->getTmpFilename();
929
        $source = $storage->getTmpFilename();
930
        $filename = 'company-' . uniqid() . '.png';
930
        $filename = 'company-' . uniqid() . '.png';
931
        $target_filename = $storage->composePathToFilename(Storage::TYPE_COMPANY, $company->uuid, $filename);
931
        $target_filename = $storage->composePathToFilename(Storage::TYPE_COMPANY, $company->uuid, $filename);
Línea 932... Línea 932...
932
 
932
 
933
        // Subir y redimensionar la imagen
933
        // Subir y redimensionar la imagen  
-
 
934
        if (!$storage->uploadImageResize($source, $target_filename, $target_width, $target_height)) {
-
 
935
            return new JsonModel([
934
        if (!$storage->uploadImageResize($source, $target_filename, $target_width, $target_height)) {
936
                'success'   => false,
-
 
937
                'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
935
            return $this->_createSimpleErrorResponse('ERROR_THERE_WAS_AN_ERROR');
938
            ]);
Línea 936... Línea 939...
936
        }
939
        }
937
 
940
 
938
        // Eliminar la imagen anterior si existe
941
        // Eliminar la imagen anterior si existe
Línea 1067... Línea 1070...
1067
                    $source = $storage->getTmpFilename();
1070
                    $source = $storage->getTmpFilename();
1068
                    $filename = 'company-cover-' . uniqid() . '.png';
1071
                    $filename = 'company-cover-' . uniqid() . '.png';
1069
                    $target_filename = $storage->composePathToFilename(Storage::TYPE_COMPANY, $company->uuid, $filename);
1072
                    $target_filename = $storage->composePathToFilename(Storage::TYPE_COMPANY, $company->uuid, $filename);
Línea 1070... Línea 1073...
1070
 
1073
 
1071
                    // Subir y redimensionar la imagen  
1074
                    // Subir y redimensionar la imagen  
1072
                    if ($storage->uploadImageResize($source, $target_filename, $target_width, $target_height)) {
1075
                    if (!$storage->uploadImageResize($source, $target_filename, $target_width, $target_height)) {
1073
                        return new JsonModel([
1076
                        return new JsonModel([
1074
                            'success'   => false,
1077
                            'success'   => false,
1075
                            'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
1078
                            'data'   =>  'ERROR_THERE_WAS_AN_ERROR'
1076
                        ]);
1079
                        ]);