We have moved to GitHub Issues
Created by Matt Brailsford 27 Aug 2012, 09:15:26 Updated by Sebastiaan Janssen 05 Jan 2016, 09:55:26
Is duplicated by: U4-629
Is duplicated by: U4-1206
Relates to: U4-6873
Relates to: U4-693
When saving files using UmbracoFile or the uploader ImageMediaFactory, thumbnail files are always saved with the .jpg file extension, even when the image/png codec is used for transparency. Should this not use a .png / .gif extension if saving with transparency?
I've added this as an issue, as I'm not sure whether this is done for a reason. At a guess, it might be implemented this way to maintain backwards compatibility for anyone expecting a .jpg extension, or it may just be a mistake.
If this ever get's implemented it would be good to also keep generating the .jpg thumbnail. A lot of packages (including DAMP) do this to get the thumbnail:
//Use the thumbnail instead of the real image. imgToShow = imgToShow.Replace("." + ext, "_thumb.jpg");
To be on the safe side, I would suggest using code similar to the following, then it doesn't matter if it get's updated or not.
imgToShow = imgToShow.Replace("." + ext, "_thumb." + ext);
Yes I can do that once this is implemented, but if users upgrade to the latest umbraco (once this is in the core) and don't upgrade my package or other packages which use this it could break things. So if this ever get's implemented at least it should be marked as a breaking change.
In your example if I have a png image I can't do "_thumb." + ext because currently it's still a jpg.
This is now fixed in U4-6873 - the jpg is still also produced so it's backwards compatible.
Backwards Compatible: True
Due in version: 7.4.0, 7.3.5