Bug #18986
closedCropping gif images
0%
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)
Updated by unbob over 16 years ago
Sorry, the original line number in class.t3lib_stdgraphic.php was 2179:
$params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.' ';
Updated by Rutger Rek over 14 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 {
...
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Closed
- Target version deleted (
0)
Closed as duplicate of #19045