Commit 17c4580c authored by Frans Saris's avatar Frans Saris Committed by Christian Kuhn
Browse files

[BUGFIX] Add +repage option when cropping images

To be sure the image (especialy gif format) is correctly repaged after
cropping it the +repage option needs to be added to the full command.

This patch adds the option for the LocalCropScaleMaskHelper and the
ImageBuilder cropscaling `crs` option.

Resolves: #83407
Releases: master, 8.7
Change-Id: I27b471d33acdc76c7af28ca0f114be72de91fcb9
Reviewed-on: https://review.typo3.org/55269

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 250ff317
......@@ -2118,7 +2118,7 @@ class GraphicalFunctions
}
$offsetX = (int)(($data[0] - $data['origW']) * ($data['cropH'] + 100) / 200);
$offsetY = (int)(($data[1] - $data['origH']) * ($data['cropV'] + 100) / 200);
$params .= ' -crop ' . $data['origW'] . 'x' . $data['origH'] . '+' . $offsetX . '+' . $offsetY . '! ';
$params .= ' -crop ' . $data['origW'] . 'x' . $data['origH'] . '+' . $offsetX . '+' . $offsetY . '! +repage';
}
$command = $this->scalecmd . ' ' . $info[0] . 'x' . $info[1] . '! ' . $params . ' ';
// re-apply colorspace-setting for the resulting image so colors don't appear to dark (sRGB instead of RGB)
......
......@@ -97,7 +97,7 @@ class LocalCropScaleMaskHelper
$configuration['fileExtension'],
'',
'',
sprintf('-crop %dx%d+%d+%d', $newWidth, $newHeight, $offsetLeft, $offsetTop),
sprintf('-crop %dx%d+%d+%d +repage', $newWidth, $newHeight, $offsetLeft, $offsetTop),
'',
['noScale' => true],
true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment