I've been beating my head against the problem of getting transparent and non-transparent PNG thumbnails to be the same color depth as the source image, to resolve a couple issues:
* Thumbnails of palette (8-bit) PNG images are currently truecolor, meaning the thumbnail is often close to the same size (in bytes) as the full-size image. The thumbnail should be the same color depth as the source. * PNGs with transparency, as a consequence, have varying degrees of transparency (rather than simply transparent/opaque), wreaking havoc with Internet Explorer, which does not support them.
There is currently some discussion on the Village Pump about my attempts at fixing these problems, by editing includes/Image.php where the thumbnailing function resides. I do not know for sure whether the GD libraries or ImageMagick are currently in use in the live version (ImageMagick was default on my installation, and from what I can tell that's what's used on the WP site). Because of the constraints of both ImageMagick (can't create palette images from truecolor) and the GD libs (a number of minor annoyances that add up to major problems), I was wondering whether it'd be okay to use a combination of the two. My very first attempt at putting them both together resulted in exactly what I was looking for. ImageMagick resizes the image (preserving any transparency), and the GD libs convert to palette.
Since I do not yet have CVS access, I am attaching a diff against the 1.19 revision of includes/Image.php. Again, I don't know if it's appropriate to use ImageMagick and GD together, but it may solve a problem that has been bothering quite a few people.
Eric
===== Do you know stuff? Contribute to Wikipedia! http://www.wikipedia.org/ Help preserve the public domain by becoming a Distributed Proofreader. http://www.pgdp.net/
_______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush
Eric Pierce wrote: [snip]
I do not know for sure whether the GD libraries or ImageMagick are currently in use in the live version
ImageMagick.
Since I do not yet have CVS access, I am attaching a diff against the 1.19 revision of includes/Image.php. Again, I don't know if it's appropriate to use ImageMagick and GD together, but it may solve a problem that has been bothering quite a few people.
Binary attachments are stripped from the list to help keep virus mails off. Best to open a bug report on bugzilla.wikipedia.org and post your patches there...
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org