Ticket #14255 (confirmed Bug)

Opened 21 months ago

Last modified 20 months ago

Broken scaling of GIF images

Reported by: mikkel@… Owned by:
Priority: minor Milestone: 4.x
Component: General Version: 4.4
Keywords: plone.app.imaging, thumbnail, scale, GIF Cc:

Description

There seems to be an issue with the scaling of palleted GIF images in plone.app.imaging 1.0.10 (at a quick glance, the issue doesn't appear to be been fixed in 1.1.1) when thumbnails are generated. I'm far from experienced with image handling, but the problem seems to be an unnecessary conversion of the image to RGBA in line 98 of monkey.py before the mode is converted back to P in line 106. Removing this unnecessary conversion solves the problem. Note that the same code seems to be present in other products as well.

Original image:  http://imgur.com/qzIxD82,UbqdusQ,r5GGdkq#0

Broken thumbnail:  http://imgur.com/qzIxD82,UbqdusQ,r5GGdkq#1

Thumbnail after fix:  http://imgur.com/qzIxD82,UbqdusQ,r5GGdkq#2

Attachments

samples.png Download (138.5 KB) - added by cwainwright 20 months ago.

Change History

Changed 20 months ago by cwainwright

comment:1 Changed 20 months ago by cwainwright

  • Status changed from new to confirmed
  • Component changed from Unknown to General

I confirm this is an issue in Plone 4.3.3 (plone.app.imaging 1.0.10), and is better in Plone 5.0a2 (plone.app.imaging 1.1.1), though in Plone 5 the gif did lose its transparency on resize, and the background displays as black instead. If the background is white, the resize works fine.

Note: See TracTickets for help on using tickets.