Auto convert upload to JPG?

I have noticed that some image uploads always convert to jpeg, this creates ugly situations with images with transparent elements and dark/light mode. I couldn’t find a setting for this, can we somehow turn this off?

I’ve tried uploading an image in webp, png and it always converts it to jpg, how so?


I’ve had this issue. I believe if you turn the compression off in the settings, it will upload properly. Not an idea place to leave that setting though for obvious reason

There are several settings which seem relevant:

  • recompress original jpg quality (“Quality of uploaded image files (1 is lowest quality, 99 is best quality, 100 to disable).”)
  • png to jpg quality (“Quality of the converted JPG file (1 is lowest quality, 99 is best quality, 100 to disable).”)
  • composer media optimization image encode quality (“JPEG encode quality used in the re-encode process.”)

I am not sure how the last one relates to the first two — or what happens to webp or other file types that aren’t PNG or JPEG.

(Also, note for any Discourse UX people reading this: inconsistent use of JPEG and JPG makes this harder to find.)


Last one is about Faster (and smaller) uploads in Discourse with Rust, WebAssembly and MozJPEG | Blog while the first two are about a server-side image optimization pipeline, so while both are about images they aren’t about the same feature.

1 Like

Let me rephrase.

I can see several separate concerns:

  • page load time / viewer bandwidth
  • server-side storage
  • server load / performance
  • upload speed
  • image quality
    • case one: diagrams, line drawings, etc., where JPEG compression is ugly and inefficient
    • (theoretical) case two: a photography forum where other concerns are not as important as preserving the image

… and I am unclear on how exactly the available settings impact these, especially with that new feature.

That should be tweaked by UX: Change JPEG to JPG for search consistency by TheJammiestDodger · Pull Request #20698 · discourse/discourse · GitHub :+1:


First 2 are server side only changes. (that can run regardless of client side support)

Last one is applied in the browser and means that you end up sending smaller payloads to the server.

1 Like