Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 553 Rev 668
Línea 465... Línea 465...
465
    public function getGroupImageForCodeAndFilename($code, $filename)
465
    public function getGroupImageForCodeAndFilename($code, $filename)
466
    {
466
    {
467
        return $this->_getProcessedImageOrCoverUrl(self::TYPE_COMPANY, $code, $filename, 'getFullPathImageGroupDefault');
467
        return $this->_getProcessedImageOrCoverUrl(self::TYPE_COMPANY, $code, $filename, 'getFullPathImageGroupDefault');
468
    }
468
    }
Línea -... Línea 469...
-
 
469
 
469
 
470
 
470
    /**
471
    /**
471
     *
472
     *
472
     * @param Group $group
473
     * @param Group $group
473
     * @return string
474
     * @return string
474
     */
475
     */
475
    public function getGroupCover($group)
476
    public function getGroupCover($group)
476
    {
477
    {
477
        return $this->_getProcessedImageOrCoverUrl(self::TYPE_COMPANY, $group->uuid, $group->cover, 'getFullPathImageGroupCoverDefault');
478
        return $this->_getProcessedImageOrCoverUrl(self::TYPE_COMPANY, $group->uuid, $group->cover, 'getFullPathImageGroupCoverDefault');
Línea -... Línea 479...
-
 
479
    }
-
 
480
 
-
 
481
    public function getGroupCoverForCodeAndFilename($code, $filename)
-
 
482
    {
-
 
483
        return $this->_getProcessedImageOrCoverUrl(self::TYPE_COMPANY, $code, $filename, 'getFullPathCoverGroupDefault');
478
    }
484
    }
479
 
485
 
480
    /**
486
    /**
481
     *
487
     *
482
     * @param Group $group
488
     * @param Group $group
Línea 904... Línea 910...
904
            $storageFileMapper->insert($storageFile);
910
            $storageFileMapper->insert($storageFile);
905
        }
911
        }
Línea 906... Línea 912...
906
 
912
 
907
 
913
 
908
        $url = 'https://' . $_SERVER['SERVER_NAME'] . '/storage/' . $code;
914
        $url = 'https://' . $_SERVER['SERVER_NAME'] . '/storage/' . $code;
909
        
915
 
Línea 910... Línea 916...
910
        return $url;
916
        return $url;
911
    }
917
    }
Línea 1088... Línea 1094...
1088
            if (isset($img) && ($img instanceof \GdImage || is_resource($img))) {
1094
            if (isset($img) && ($img instanceof \GdImage || is_resource($img))) {
1089
                imagedestroy($img);
1095
                imagedestroy($img);
1090
            }
1096
            }
1091
            if (isset($new_image) && ($new_image instanceof \GdImage || is_resource($new_image))) {
1097
            if (isset($new_image) && ($new_image instanceof \GdImage || is_resource($new_image))) {
1092
                imagedestroy($new_image);
1098
                imagedestroy($new_image);
1093
            } 
1099
            }
1094
            if (isset($source_filename) && file_exists($source_filename)) {
1100
            if (isset($source_filename) && file_exists($source_filename)) {
1095
                 unlink($source_filename);
1101
                unlink($source_filename);
1096
            }
1102
            }
1097
            return false;
1103
            return false;
1098
        }
1104
        }
1099
    }
1105
    }
Línea 1182... Línea 1188...
1182
                if ($new_image === false) {
1188
                if ($new_image === false) {
1183
                    imagedestroy($img);
1189
                    imagedestroy($img);
1184
                    unlink($source_filename);
1190
                    unlink($source_filename);
1185
                    return false;
1191
                    return false;
1186
                }
1192
                }
1187
                
1193
 
1188
                imageCopyResampled($new_image, $img, 0, 0, 0, 0, $source_width, $source_height, $source_width, $source_height);
1194
                imageCopyResampled($new_image, $img, 0, 0, 0, 0, $source_width, $source_height, $source_width, $source_height);
1189
                imagedestroy($img);
1195
                imagedestroy($img);
Línea 1190... Línea 1196...
1190
 
1196
 
1191
                return $this->_savePngAndCleanup($new_image, $target_filename, $source_filename);
1197
                return $this->_savePngAndCleanup($new_image, $target_filename, $source_filename);