I don't think I've seen this discussed before and a search didn't turn up much. I'd like to know if anybody has any success in modifying the image resizing methods to accommodate PNG images that have transparency. It seems that in the process of resizing, it converts the image to a jpg and that gets rid of the transparency. Unfortunately, that results in a grey background, which looks quite ugly on some images that are meant to have transparency.
Only thing I can think of is your environment includes and older version of the GD library that doesn't support imagesavealpha(). The function used to keep transparency (its called in the silverstripe GD wrapper). I know I've had this problem on certain hosts when their "default" php build is missing some updated or usually included modules. Takes forever to debug those :)
The GD library came bundled with my server stack. It seems to be the latest version.
Running PHP 5.3.5 if that helps to know.
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 6b
PNG Support enabled
libPNG Version 1.2.10
WBMP Support enabled
XPM Support enabled
XBM Support enabled
Hmm should be working, I know its working on 2.4.2 which leads me to believe its something to do with your specific install. Try writing a specific function to resize a png and see if fails. Something like this
Also check your logs to see if there's any error. I know the GD library actually needs a lot of memory if you're resizing a lot large images.
Finally check to make sure there aren't any extra alpha channels or paths in your image I know that has cause weird errors in the past for me