Images resampled even if below max image size kb

AI-generated summary

Images are being resampled even if they are below the set max image size kb in Discourse. davidkingham noticed this issue, where posted images are being downsized and experiencing slight changes in color and clarity. This is a concern for a photography group, where image quality is crucial.

davidkingham discovered that the download button in the lightbox downloads a resampled version of the image, not the original. The “view full size” option also downloads a smaller image, except in Safari where it downloads a JPG.

mattdm pointed out a relevant thread on client-side optimization, which likely causes the issue. davidkingham later found the recompress original jpg quality setting, which was the solution to the problem.

It was my understanding that images below the filesize defined in max image size kb would not be resampled, but I am not seeing this. For example, I have that setting set to 3000 KB; I have a jpg that is 2.4 MB, but when I post the image, then use the download button in the lightbox, that resulting jpg is 1.4 MB. Even with smaller files, this is the case, 863 KB original, 542 KB download. The images appear that they have been resampled as well, with slight changes in color and clarity. For a group of discerning photographers, this is not good as they notice every little change to their images. Any ideas why this may be happening and any way to avoid it? I fully appreciate that images above 3 MB should be downsampled, but below that, it would be best to leave them alone if possible.

I did some more reading, and I understand that discourse creates thumbnails for the lightbox that are presumably downsampled. Is the download button in the lightbox downloading that resampled version and not the original? Also, if I click the ‘view full size’ and download that image, it’s a .webp, except in Safari, then I get a jpg, but it’s still smaller than the original. Just trying to wrap my head around all of this! Thanks!

See this thread:

I assume what you’re seeing is the client-side optimization.

How did I miss recompress original jpg quality ! Argh, thank you Matt!