Remote image conversion ignores jpg quality setting

AI-generated summary

The “Convert remote images to local images” setting in Discourse ignores the PNG to JPG conversion setting, causing PNG images to lose transparency when converted. simon explains that to prevent PNG conversion, both the png to jpg quality and recompress original jpg quality settings must be set to 100. However, even with these settings, PNG images pasted into the composer will still be automatically converted to JPGs. Stanzilla and Stanzilla suggest improving the settings page or documentation to clarify this behavior and provide an option to disable automatic PNG conversion.

The “Convert remote images to local images by downloading them; this prevents broken images.” setting

Is ignoring the png → jpg conversion setting. I put an imgur link of a png into a post and when the system downloads that file, it is converted to jpg and loses transparency.

I am not sure this is a bug, but the way that Discourse handles conversion from PNG to JPG images is not obvious. There are two settings that control it. To prevent PNGs from being converted, you need to set both the png to jpg quality and recompress original jpg quality settings to 100. One other thing to note is that PNG images will be automatically converted to JPGs if they are pasted into the composer. I don’t believe the latter issue will affect Imgur links, but it is possible that I am wrong about that.

It would be great if we could find a way of making it clear on the settings page how these settings can be used to prevent PNGs from being converted. If that can’t be done, we’ll need to properly document the functionality on Meta.

1 Like

Yeah would be nice if I could disable that auto converting behavior