Bug #83407
closed
Cropping gif images results in errornous images
Added by Claus Harup almost 7 years ago.
Updated about 6 years ago.
Description
Having a .gif image and trying to crop anywhere else than from (0,0) gives me an errornous image - both in the preview in BE and also when the image is processed in FE :-(
Files
What's the use-case for such a big gif image? Isn't it an option to go for a JPEG?
Is it a multi frame image?
Do you have the same issue with other gif files?
Hi Frans
....sure it an option to go with .png or .jpg, but tell that to ALL your clients :-)
Any gif I tried with..... - I have attached 3 images:
xmas.jpg (original)
xmas.png (xmas.jpg saved as .png)
xmas.gif (xmas.jpg saved as .gif)
..... so Im sure that the gif is not an animated gif :-)
I have cropped them all with 16:9 in the middle of the image and still the .gif fails :-(
Greatings Claus
confirmed, the result is a transparent image with the dimensions of the original with the cropped part.
Ok, looks like a GM issue:
command when processing gif files:
'/usr/bin/convert' +profile '*' -geometry 2000x1331! -crop 454x375+982+511 '/var/www/master/Web/content/user_upload/xmas.gif[0]' '/var/www/master/Web/typo3temp/assets/images/crop_b7068225b8.gif'
command when processing jpg files:
'/usr/bin/convert' +profile '*' -geometry 1900x1200! -crop 788x731+716+269 '/var/www/master/Web/content/user_upload/8583557560_ea525fcd38_o.jpg[0]' '/var/www/master/Web/typo3temp/assets/images/crop_3454656605.jpg'
Looks like we need to add some extra processing options for gif files https://stackoverflow.com/a/14036766/2757523
- Animated gifs are often optimised to save space, but imagemagick doesn't seem to consider this when applying the crop command and treats each frame individually.
-coalesce
rebuilds the full frames.
- Crop does not remove the canvas that it snipped from the image. Applying
+repage
after the crop will do this.
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF