How to avoid any kind of recompression on images?

We are a photography forum.

We want to limit image uploads to 1.2 MB but avoid any kind of recompression when the image complies with that limit.

We would prefer that if the images is bigger, the user is adviced and don’t let him upload it.
But I have not found how to do that.

When someones uploads an image that is a bit more heavy, the system agressively redimensions and recompress it, and users complain that the forum has ruined their photo (less detail, color gradation, etc).

With the addition image composer options (recently) things are worse. Even images that weight less than 1.2 MB are recompressed.

We want to avoid any kind of intervention on the user image (it is his responsability tweaking the image to his like with the limitation in weight and size).
At least with images that adhere to given limitation.

How to best configure options to get this behaviour?

I think we cannot avoid recompression in images that do not complain with limits, but at least we want to avoid it in images that comply and control compression of the ones that exceed.

Forum tends to compress them too much and give results like 200KB and 900 pixels in large side.

I think you’d need a plugin to override those behaviors.

Or have them upload elsewhere and link.

But I think there is a plugin or theme component that allows uploading images elsewhere like minio. Something like that might be what you want.

See Azure Blob Storage Plugin and Video Upload to YouTube and Vimeo using Theme Component as examples. You’d need to decide where to host the images and write a similar theme component.

mmm… we want the images in our server as we have no control of other sites where images can be lost.

I have assumed we are not going to be able to completly disable image processing.

We are glad just if the the system don’t touch images that comply to limits (1.2 MB in file size and 2048 pixels in large side) and if we can tweak a bit the recompression for that images that exceed limits.

I think I could managed to get first goal: just I have stablished limit in file size to 1230 KB and the threshold in image composer to the same size in bytes.

Now it seems that images with less than that size are not recompressed (as it worked some versions ago, it seems image composer has been introduced recently).

But when you try to upload an image say 2100 pixels and 3 MB you get weird results.
It is resized to something like 900 pixels and 200 KB other times 1024 and 500 KB…
The image loses its detail completly and the color grading.

I have configured image compoler limits to 1920 pixels and jpeg compression quality to 90, so I would have expected it to recompress to that size (I have tested with images that can be compressed with 90 quality and 1920 pixels easily within the 1.2 MB limit).
But systems keeps compressing it far too much.