Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 818 Rev 820
Línea 1039... Línea 1039...
1039
     * @param string $sourceFilenameToUnlink The path to the source file to unlink.
1039
     * @param string $sourceFilenameToUnlink The path to the source file to unlink.
1040
     * @return bool True on success, false on failure.
1040
     * @return bool True on success, false on failure.
1041
     */
1041
     */
1042
    private function _savePngAndCleanup($imageResource, $targetFilename, $sourceFilenameToUnlink)
1042
    private function _savePngAndCleanup($imageResource, $targetFilename, $sourceFilenameToUnlink)
1043
    {
1043
    {
-
 
1044
        $storageDir = $this->config['leaderslinked.storage.path'];
-
 
1045
        $storageFileFullPath = $storageDir . DIRECTORY_SEPARATOR . $targetFilename;
-
 
1046
 
1044
        $save_success = imagepng($imageResource, $targetFilename);
1047
        $save_success = imagepng($imageResource, $storageFileFullPath);
1045
        imagedestroy($imageResource); // Clean up the image resource
1048
        imagedestroy($imageResource); // Clean up the image resource
Línea 1046... Línea 1049...
1046
 
1049
 
1047
        if ($save_success) {
1050
        if ($save_success) {
1048
            if ($sourceFilenameToUnlink && file_exists($sourceFilenameToUnlink)) {
1051
            if ($sourceFilenameToUnlink && file_exists($sourceFilenameToUnlink)) {
1049
                unlink($sourceFilenameToUnlink);
1052
                unlink($sourceFilenameToUnlink);
1050
            }
1053
            }
1051
            return true;
1054
            return true;
1052
        } else {
1055
        } else {
1053
            error_log("_savePngAndCleanup: imagepng failed to save image to {$targetFilename}.");
1056
            error_log("_savePngAndCleanup: imagepng failed to save image to {$storageFileFullPath}.");
1054
            return false;
1057
            return false;
1055
        }
1058
        }
Línea 1056... Línea 1059...
1056
    }
1059
    }