[BUGFIX] Apply image cropping to click-enlarged images 26/47126/2
authorOliver Hader <oliver@typo3.org>
Sat, 5 Mar 2016 23:26:42 +0000 (00:26 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 5 Mar 2016 23:37:42 +0000 (00:37 +0100)
Image cropping is not applied to click-enlarged images, neither if
using the lightbox-mode nor the regular mode using tx_cms_showpic.
Cropping is applied in these scenarios as well with transporting
the accordant crop value of the current image being processed.

Resolves: #72798
Releases: master, 7.6
Change-Id: I3e07fc447ac8a35cbe4fbb43bac9adb9bb7ed506
Reviewed-on: https://review.typo3.org/47126
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/css_styled_content/static/setup.txt
typo3/sysext/fluid_styled_content/Configuration/TypoScript/Static/Setup/lib.fluidContent.ts
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Controller/ShowImageController.php

index 8bdcba3..9af01c5 100644 (file)
@@ -712,6 +712,7 @@ tt_content.image.20 {
                        width = {$styles.content.imgtext.linkWrap.width}
                        height = {$styles.content.imgtext.linkWrap.height}
                        effects = {$styles.content.imgtext.linkWrap.effects}
+                       crop.data = file:current:crop
 
                        JSwindow = 1
                        JSwindow.newWindow = {$styles.content.imgtext.linkWrap.newWindow}
index 6fceae1..00308ef 100644 (file)
@@ -24,6 +24,7 @@ lib.fluidContent {
                                wrap = <a href="javascript:close();"> | </a>
                                width = {$styles.content.textmedia.linkWrap.width}
                                height = {$styles.content.textmedia.linkWrap.height}
+                               crop.data = file:current:crop
 
                                JSwindow = 1
                                JSwindow {
index 84eacc5..d7dae59 100644 (file)
@@ -1791,7 +1791,7 @@ class ContentObjectRenderer
 
         // Create imageFileLink if not created with typolink
         if ($content === $string) {
-            $parameterNames = array('width', 'height', 'effects', 'bodyTag', 'title', 'wrap');
+            $parameterNames = array('width', 'height', 'effects', 'bodyTag', 'title', 'wrap', 'crop');
             $parameters = array();
             $sample = isset($conf['sample.']) ? $this->stdWrap($conf['sample'], $conf['sample.']) : $conf['sample'];
             if ($sample) {
index 3c36691..50526ef 100644 (file)
@@ -57,6 +57,11 @@ class ShowImageController
     protected $height;
 
     /**
+     * @var string
+     */
+    protected $crop;
+
+    /**
      * @var int
      */
     protected $frame;
@@ -178,7 +183,7 @@ EOF;
             'width' => $this->width,
             'height' => $this->height,
             'frame' => $this->frame,
-
+            'crop' => $this->crop,
         );
         return $this->file->process('Image.CropScaleMask', $processingConfiguration);
     }