Issue Bug Closed

#19045Cropscale incorrectly crops GIF files

Felix Buenemann 07/02/08, 01:37 updated 10/02/18, 12:29

Description

If using cropscale on an imgResource object with a GIF input file whose width is larger than its height eg. 120×80px and cropping to a box eg. 100×100px it will be correctly scaled up to 150×100px and the image area is cropped to 100×100px, but the output file is padded with empty pixels to 150px width, instead of the expected 100px.
PNG and JPG input files are unaffected.

TypoScript/PHP used:
$ts[‘img’] = ‘IMAGE’;
$ts[‘img.’][‘file’] = $imgFullPath;
$ts[‘img.’][‘file.’][‘format’] = ‘jpg’;
$ts[‘img.’][‘file.’][‘quality’] = 90;
$ts[‘img.’][‘file.’][‘width’] = ‘107c’; // This is currently buggy with GIF files (as of T3 4.2.1)
$ts[‘img.’][‘file.’][‘height’] = ‘107c’;

// render thumbnail
$thumbnailImg = $this->cObj->IMAGE;

Typo3 config:
[GFX][gdlib] = 1
[GFX][gdlib_png] = 1
[GFX][im] = 1
[GFX][im_version_5] = im6
[GFX][im_v5effects] = -1
[GFX][im_noScaleUp] = 0
[GFX][png_truecolor] = 1

ImageMagick-6.4.1-8 Macport
PHP 5.2.5 using bundled gdlib (2.0.34 compatible)

Sample attached.
(issue imported from #M8878)

Reviews 1