U4-694 - Image thumbnails always have the .jpg extension

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?


Matt Brailsford 27 Aug 2012, 09:16:30

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.

Jeroen Breuer 05 Nov 2012, 12:51:03

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");

Matt Brailsford 05 Nov 2012, 12:55:40

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);

Jeroen Breuer 05 Nov 2012, 13:01:04

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.

Sebastiaan Janssen 15 Dec 2015, 10:16:19

This is now fixed in U4-6873 - the jpg is still also produced so it's backwards compatible.

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.4.0, 7.3.5


Story Points: