Project

General

Profile

Bug #16411 » 3949_v1.diff

Administrator Admin, 2009-02-27 12:35

View differences:

t3lib/class.t3lib_stdgraphic.php (working copy)
* @param pointer The GDlib image resource pointer
* @param string The filename to write to
* @param integer The image quality (for JPEGs)
* @return mixed The output of either imageGif, imagePng or imageJpeg based on the filename to write
* @return boolean The output of either imageGif, imagePng or imageJpeg based on the filename to write
* @see maskImageOntoImage(), scale(), output()
*/
function ImageWrite($destImg, $theImage, $quality=0) {
imageinterlace ($destImg,0);
$ext = strtolower(substr($theImage, strrpos($theImage, '.')+1));
$result = FALSE;
switch ($ext) {
case 'jpg':
case 'jpeg':
......
if ($quality == 0) {
$quality = $this->jpegQuality;
}
return imageJpeg($destImg, $theImage, $quality);
$result = imageJpeg($destImg, $theImage, $quality);
}
break;
case 'gif':
......
if ($this->truecolor) {
imagetruecolortopalette($destImg, true, 256);
}
return imageGif($destImg, $theImage);
$result = imageGif($destImg, $theImage);
}
break;
case 'png':
if (function_exists('imagePng')) {
return ImagePng($destImg, $theImage);
$result = ImagePng($destImg, $theImage);
}
break;
}
return false; // Extension invalid or write-function does not exist
if ($result) {
t3lib_div::fixPermissions($theImage);
}
return $result; // Extension invalid or write-function does not exist
}
(7-7/7)