Committing fix for bug #5911 (written by Martin Kutschker, but it seems like he only...
authorMichael Stucki <michael.stucki@typo3.org>
Tue, 16 Oct 2007 16:07:41 +0000 (16:07 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Tue, 16 Oct 2007 16:07:41 +0000 (16:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-1@2572 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_stdgraphic.php

index a807c7e..7281202 100644 (file)
@@ -2757,17 +2757,21 @@ class t3lib_stdGraphic  {
         *
         * @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
         * @see maskImageOntoImage(), scale(), output()
         */
-       function ImageWrite($destImg, $theImage)        {
+       function ImageWrite($destImg, $theImage, $quality=0)    {
                imageinterlace ($destImg,0);
                $ext = strtolower(substr($theImage, strrpos($theImage, '.')+1));
                switch ($ext)   {
                        case 'jpg':
                        case 'jpeg':
                                if (function_exists('imageJpeg'))       {
-                                       return imageJpeg($destImg, $theImage, $this->jpegQuality);
+                                       if ($quality == 0)      {
+                                               $quality = $this->jpegQuality;
+                                       }
+                                       return imageJpeg($destImg, $theImage, $quality);
                                }
                        break;
                        case 'gif':