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.

1 Like

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.

1 Like

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.

3 Likes

Have you edited the site settings related to maximum image size, width and height? That should be your first port of call…

1 Like

Sorry for the delay. I have not realized of the answer.

Yes, as I have explained previously, we have stablished a limit of 1.2 MB and a resolution limit of 4 MP.

When the image does not comply to that limit, the system compresses it strongly, sometime with mad results as 600 pixels or 1000 pixels wide for an image that has been uploaded with 1920 or 2048 pixels wide.
The lost in quality is more than evident for a trained eye: textures missing, halos, bad color grading…

With the recent upgrades, even images that comply to limits get a system “improvement” and are compressed with quality loses.

We have tweaked the “recompress original jpg quality” and set 100% in the hope of preventing recompression. It seems to work but I am not sure if it gets a recompression anyway (but at least there is no visible quality loss).

1 Like

You need to tweak the composer media optimization image bytes optimization threshold to disable the client size optimization of images below that size. The default applies to images above 500Kb, so you want to increase that setting to 1.2MB.

2 Likes

Should we improve the description of these site settings to make it clearer how things work? :thinking:

1 Like

I think so, but writing copy isn’t my forte.

Currently it’s

Minimum image file size to trigger client-side optimization

Maybe

Minimum image file size to trigger resize / compression before upload

?

2 Likes

Maybe

Images larger than this will be resized and compressed by the client

4 Likes