Project

General

Profile

Actions

Bug #18986

closed

Cropping gif images

Added by unbob almost 16 years ago. Updated almost 11 years ago.

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

0%

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

Description

Hi

I wanted to crop my gif's into squares, using the 'c' operator.
10.file.width = 53c
10.file.height = 53c

The problem is, as explained on this image magick page:
http://www.imagemagick.org/Usage/crop/

"The size of the displayed image (its 'virtual canvas' or page size) has not been effected by the "-crop" operation. The actual image itself has been cropped, and may be smaller, but the canvas on which the GIF image is displayed is still the same size as the original canvas."

This resulted in a gif like this, with the cropped away area being transparent, but still there:
http://www.imagemagick.org/Usage/crop/crop.gif

I tried all sort of params on the image, +repage and -page 0x0+0+0 and so on, but nothing fixed it. I got tired of trying to find a good solution, so I just changed the code in class.t3lib_stdgraphic.php.

Original line 2189 in class.t3lib_stdgraphic.php:
$params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.' ';

I added an exclamation mark:
$params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.'! ';

changing the IM-command from:
convert -geometry 53x80! -colors 64 -crop 53x53+0+13 orig.gif new.gif

to:
convert -geometry 53x80! -colors 64 -crop 53x53+0+13! orig.gif new.gif

Sorry if the explanation is a bit lacking, if you have any questions I will try my best to answer.

ImageMagick 6.2.5
(issue imported from #M8763)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #19045: Cropscale incorrectly crops GIF filesClosed2008-07-02

Actions
Actions #1

Updated by unbob almost 16 years ago

Sorry, the original line number in class.t3lib_stdgraphic.php was 2179:
$params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.' ';

Actions #2

Updated by Rutger Rek over 13 years ago

problem also occurs in im 6.2.8. workaround include the IMAGE object in a GIFBUILDER object

10 = IMAGE
10 {
file = GIFBUILDER
file {
XY = 67,67
10 = IMAGE
10 {
...
Actions #3

Updated by Alexander Opitz almost 11 years ago

  • Status changed from New to Closed
  • Target version deleted (0)

Closed as duplicate of #19045

Actions

Also available in: Atom PDF