Bug #16545
closedGIFBUILDER indexcolors cropsized images
0%
Description
Giving the gifbuidler the command to cropsize an image makes him convert the image to a gif, even if both source and destination are truecolored images like jpg. The following directive leads to an ugly result, at least in the typo3-version 4.0 im currently running on:
temp.test = IMAGE
temp.test.file {
file = fileadmin/debug/teaser.jpg
file.width = 550c
file.height = 150c
}
As this is a “simple” image-action, the directive is delegated to imageMagickConvert() in class.t3lib_stdgraphic.php. There is a special handling for cropsized images useing, after scaleing the image, a gifbuilder-object in order to create an offest for the the final result. Somewhere along the way, this gifbuilder creates a gif-file out of jpeg files. I simply replaced the gifbuilder-call by another imagemagick-call, working pretty fine for me:
if ($data['crs']) {
if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) {
$crsOutput = str_replace('pics/', 'pics/crs-', $output);
$this->imageMagickExec($imagefile.$frame, $output, $command);
if (!$data['origW']) $data['origW'] = $data[0];
if (!$data['origH']) $data['origH'] = $data[1];
$ofX = intval(($info[0] - $data['origW']) / 2 * (($data['cropH'] + 100) / 200));
$ofY = intval(($info[1] - $data['origH']) / 2 * (($data['cropV'] + 100) / 200));
$command = '-crop ' . $data['origW'] . 'x' . $data['origH'] . '+' . $ofX . '+' . $ofY;
$this->imageMagickExec($output, $output, $command);
(issue imported from #M4186)
Files