[BUGFIX] Fix crop in uri.image ViewHelper 37/42337/2
authorGeorg Ringer <georg.ringer@gmail.com>
Fri, 7 Aug 2015 05:16:33 +0000 (07:16 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 7 Aug 2015 07:13:08 +0000 (09:13 +0200)
Fix cropping in the uri.image ViewHelper by moving the lines
below the initialization of the image itself.

Change-Id: Ia7d5efdf2d79e3d0448198bbae05fe9df46abc07
Resolves: #68719
Releases: master
Reviewed-on: http://review.typo3.org/42337
Reviewed-by: Josef Glatz <jousch@gmail.com>
Tested-by: Josef Glatz <jousch@gmail.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/fluid/Classes/ViewHelpers/Uri/ImageViewHelper.php

index 72fd30f..a03010d 100644 (file)
@@ -116,13 +116,14 @@ class ImageViewHelper extends AbstractViewHelper  implements CompilableInterface
                if (is_null($src) && is_null($image) || !is_null($src) && !is_null($image)) {
                        throw new Exception('You must either specify a string src or a File object.', 1382284105);
                }
+
+               $imageService = self::getImageService();
+               $image = $imageService->getImage($src, $image, $treatIdAsReference);
+
                if ($crop === NULL) {
                        $crop = $image instanceof FileReference ? $image->getProperty('crop') : NULL;
                }
 
-               $imageService = self::getImageService();
-
-               $image = $imageService->getImage($src, $image, $treatIdAsReference);
                $processingInstructions = array(
                        'width' => $arguments['width'],
                        'height' => $arguments['height'],