14050_cleaning_t3lib_arraybrowser
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_stdgraphic.php
index 664aac7..eb39538 100644 (file)
@@ -256,7 +256,10 @@ class t3lib_stdGraphic     {
                        $this->png_truecolor = true;
                }
                if (!$gfxConf['im_version_5'])  {
+                       t3lib_div::deprecationLog('The option $TYPO3_CONF_VARS[\'GFX\'][\'im_version_5\'] is not set, ImageMagic 4 is assumed. This is deprecated since TYPO3 4.5, support will be removed in TYPO3 4.6. Make sure to upgrade to ImageMagick version 6 or GraphichsMagick.');
                        $this->im_version_4 = true;
+               } elseif ($gfxConf['im_version_5'] === 'im5') {
+                       t3lib_div::deprecationLog('The option $TYPO3_CONF_VARS[\'GFX\'][\'im_version_5\'] is set to \'im5\'. This is deprecated since TYPO3 4.5, support will be removed in TYPO3 4.6. Make sure to upgrade to ImageMagick version 6 or GraphichsMagick.');
                }
 
                        // When GIFBUILDER gets used in truecolor mode
@@ -298,7 +301,6 @@ class t3lib_stdGraphic      {
                }
                if ($gfxConf['im_no_effects'])  {
                                // Boolean. This is necessary if using ImageMagick 5+.
-                               // Approved version for using effects is version 4.2.9.
                                // Effects in Imagemagick 5+ tends to render very slowly!!
                                // - therefore must be disabled in order not to perform sharpen, blurring and such.
                        $this->NO_IM_EFFECTS = 1;
@@ -2332,10 +2334,20 @@ class t3lib_stdGraphic  {
                                $w=$data['origW'];
                                $h=$data['origH'];
 
-                                       // if no convertion should be performed
-                               $wh_noscale = (!$w && !$h) || ($data[0]==$info[0] && $data[1]==$info[1]);               // this flag is true if the width / height does NOT dictate the image to be scaled!! (that is if no w/h is given or if the destination w/h matches the original image-dimensions....
-
-                               if ($wh_noscale && !$data['crs'] && !$params && !$frame && $newExt==$info[2] && !$mustCreate) {
+                                       // if no conversion should be performed
+                                       // this flag is true if the width / height does NOT dictate 
+                                       // the image to be scaled!! (that is if no width / height is
+                                       // given or if the destination w/h matches the original image
+                                       // dimensions or if the option to not scale the image is set)
+                               $noScale = (!$w && !$h) || ($data[0] == $info[0] && $data[1] == $info[1]) || $options['noScale'];
+
+                               if ($noScale && !$data['crs'] && !$params && !$frame && $newExt == $info[2] && !$mustCreate) {
+                                               // set the new width and height before returning, 
+                                               // if the noScale option is set
+                                       if ($options['noScale']) {
+                                               $info[0] = $data[0];
+                                               $info[1] = $data[1];
+                                       }
                                        $info[3] = $imagefile;
                                        return $info;
                                }