Project

General

Profile

Actions

Bug #19045

closed

Cropscale incorrectly crops GIF files

Added by Felix Buenemann over 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-07-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If using cropscale on an imgResource object with a GIF input file whose width is larger than its height eg. 120x80px and cropping to a box eg. 100x100px it will be correctly scaled up to 150x100px and the image area is cropped to 100x100px, 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)


Files

crs_scaling_bug.gif (7.26 KB) crs_scaling_bug.gif Administrator Admin, 2008-07-02 01:37
bug_8878_fix_v1.patch (781 Bytes) bug_8878_fix_v1.patch Administrator Admin, 2010-06-01 15:54
img300x200.gif (1.71 KB) img300x200.gif Administrator Admin, 2010-07-16 15:59
bug_8878_fix_testcase (2.42 KB) bug_8878_fix_testcase Administrator Admin, 2010-07-16 17:21
bug_8878_fix_v1b_svn8197.patch (860 Bytes) bug_8878_fix_v1b_svn8197.patch Administrator Admin, 2010-07-16 17:23
bug_8878_fix_v1b_updated_4_5_19.patch (877 Bytes) bug_8878_fix_v1b_updated_4_5_19.patch Adapted original patch to 4.5.19 Felix Buenemann, 2012-08-21 23:24
19045-original.png (2.62 KB) 19045-original.png Ernesto Baschny, 2013-09-17 20:43
19045-im6-nopatch.png (3.24 KB) 19045-im6-nopatch.png Ernesto Baschny, 2013-09-17 20:43
19045-im6-patched.png (3.17 KB) 19045-im6-patched.png Ernesto Baschny, 2013-09-17 20:43
19045-gm-no-patch.png (3.06 KB) 19045-gm-no-patch.png Ernesto Baschny, 2013-09-17 20:43
19045-gm-patched.png (3.07 KB) 19045-gm-patched.png Ernesto Baschny, 2013-09-17 20:43

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #18566: Image crop does not work in RC1Closed2008-04-05

Actions
Related to TYPO3 Core - Bug #18986: Cropping gif imagesClosed2008-06-19

Actions
Actions

Also available in: Atom PDF