ZenphotoCMS Forum
png image transparent background on thumbnail resize becomes black... - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: png image transparent background on thumbnail resize becomes black... (/thread-2397.html)



png image transparent background on thumbnail resize becomes black... - Appaz - 2008-03-11

Hello

When a png image file with transparent background is uploaded, when it is resized for thumbnail view, it converts to an image with black background, where it was transparent before...

Is there any way i could make it:

1.) to resize with WHITE background, not black, as it is now
2.) to resize to same png format image (not jpg) and keep transparent background where it was?

Thanks for your replies in advance, guys!
Cheers!

P.S.
Thanks for that great gallery!




png image transparent background on thumbnail resize becomes black... - sbillard - 2008-03-11

This seems like a bug. Can you create a ticket on Trac so we can deal with it?




png image transparent background on thumbnail resize becomes black... - RachelL - 2008-11-30

The same thing happens with .gifs (animated and non-animated). In the thumbnail of each gif, the areas that are transparent on the original image end up black on the thumbnail.

If it isn't possible to fix that, would it be possible to use my own premade .gif thumbs? I tried putting them in the cache folder but the .jpg version is always used, and if I delete it a new one is made.. I can't get it to use the .gif thumbnail.

Thanks for any help!




png image transparent background on thumbnail resize becomes black... - acrylian - 2008-11-30

No, sorry, the internal image processor only creates jpgs. So even if you upload gifs or pngs they will be turned into jpgs. This is always the case for thumbnails. But you can show gifs and pngs directly on the image.php page (the bigger image we call "sized image") if they are the same size or small than the image size setting on the theme options tab.




png image transparent background on thumbnail resize becomes black... - RachelL - 2008-11-30

Thanks for your help acrylian,

Would you know if it is possible then to not have thumbnails generated at all, and to display the original image as the thumbnail (the images I'm displaying are very small sized .gifs)?




png image transparent background on thumbnail resize becomes black... - acrylian - 2008-12-01

Sorry again, no, this is just not the way Zenphoto works.




png image transparent background on thumbnail resize becomes black... - sbillard - 2008-12-01

You can, of course, display the original image. But if you want a small version you would have to use the browser resizing since zenphoto if it resizes an image will always create a jpeg.

You would change the theme where it is printing a thumbnail to print the full image. There is no function which does that, though so you will have to create the HTML using the getUnprotectedImage function.




png image transparent background on thumbnail resize becomes black... - stinie - 2009-12-08

just discovered the same thing. wanted to use zenphoto for new project of mine. what a pity

anyhow I use zenphoto for a lot of projects. I'm very happy about it.

thanks anyway for everything.
have a nice day

cheers, stinie




png image transparent background on thumbnail resize becomes black... - acrylian - 2009-12-08

Just to note, Zenphoto does not turn everything into jpegs anymore (since 1.2.6 or 1.2.5, not sure right now). Sadly the GDlib is the reason for transparency to not work correctly. This is sadly out of our hands.