¿Cómo evitar cualquier tipo de recompresión en las imágenes?

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 me gusta

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 me gusta

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 Me gusta

¿Has editado la configuración del sitio relacionada con el tamaño máximo de imagen, el ancho y la altura? Ese debería ser tu primer paso.

1 me gusta

Disculpa la demora. No me había dado cuenta de la respuesta.

Sí, como expliqué anteriormente, hemos establecido un límite de 1,2 MB y un límite de resolución de 4 MP.

Cuando la imagen no cumple con ese límite, el sistema la comprime fuertemente, a veces con resultados desastrosos como 600 píxeles o 1000 píxeles de ancho para una imagen que se subió con 1920 o 2048 píxeles de ancho.
La pérdida de calidad es más que evidente para un ojo entrenado: texturas faltantes, halos, mala gradación de color…

Con las recientes actualizaciones, incluso las imágenes que cumplen los límites reciben una “mejora” del sistema y se comprimen con pérdidas de calidad.

Hemos ajustado la “calidad jpg original de recompresión” y la hemos establecido en 100% con la esperanza de evitar la recompresión. Parece funcionar, pero no estoy seguro de si de todos modos se produce una recompresión (pero al menos no hay pérdida de calidad visible).

1 me gusta

Necesitas ajustar el umbral de optimización de bytes de imagen de composer media optimization para deshabilitar la optimización de tamaño del cliente de imágenes por debajo de ese tamaño. El valor predeterminado se aplica a imágenes de más de 500 KB, por lo que querrás aumentar esa configuración a 1,2 MB.

2 Me gusta

¿Deberíamos mejorar la descripción de esta configuración del sitio para que quede más claro cómo funcionan las cosas? :thinking:

1 me gusta

Creo que sí, pero escribir textos no es mi fuerte.

Actualmente es

Tamaño mínimo de archivo de imagen para activar la optimización del lado del cliente

¿Quizás?

Tamaño mínimo de archivo de imagen para activar el redimensionamiento / compresión antes de la carga.

?

2 Me gusta

Quizás

Las imágenes más grandes que esta serán redimensionadas y comprimidas por el cliente.

4 Me gusta