Fixed bug #5911: GIFBUILDER setting quality not honoured
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 7 Oct 2007 09:25:17 +0000 (09:25 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 7 Oct 2007 09:25:17 +0000 (09:25 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2538 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_stdgraphic.php

index ae45083..7e68325 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
 
+2007-10-07  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * Fixed bug #5911: GIFBUILDER setting quality not honoured
+
 2007-10-06  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
        * Fixed bug #6462: Wrong default locale charset on Windows
index 5b9485b..115c0e5 100644 (file)
@@ -2761,17 +2761,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':