Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 816 Rev 817
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
        $storage_root_path = $this->config['leaderslinked.storage.path'];
-
 
1045
        $target_filename_path = $storage_root_path . DIRECTORY_SEPARATOR . $targetFilename;
1044
        $save_success = imagepng($imageResource, $targetFilename);
1046
        $save_success = imagepng($imageResource, $target_filename_path);
1045
        imagedestroy($imageResource); // Clean up the image resource
1047
        imagedestroy($imageResource); // Clean up the image resource
Línea 1046... Línea 1048...
1046
 
1048
 
1047
        if ($save_success) {
1049
        if ($save_success) {
1048
            if ($sourceFilenameToUnlink && file_exists($sourceFilenameToUnlink)) {
1050
            if ($sourceFilenameToUnlink && file_exists($sourceFilenameToUnlink)) {
1049
                unlink($sourceFilenameToUnlink);
1051
                unlink($sourceFilenameToUnlink);
1050
            }
1052
            }
1051
            return true;
1053
            return true;
1052
        } else {
1054
        } else {
1053
            error_log("_savePngAndCleanup: imagepng failed to save image to {$targetFilename}.");
1055
            error_log("_savePngAndCleanup: imagepng failed to save image to {$target_filename_path}.");
1054
            return false;
1056
            return false;
1055
        }
1057
        }
Línea 1056... Línea 1058...
1056
    }
1058
    }