画像の再圧縮を回避する方法は?

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

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

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

サイト設定で、画像の最大サイズ、幅、高さを編集しましたか?まずそこを確認してください。

「いいね!」 1

遅くなり申し訳ありません。回答に気づきませんでした。

はい、以前説明したとおり、1.2MBの制限と4MPの解像度制限を設けています。

画像がその制限を満たさない場合、システムは画像を強く圧縮します。時には、1920ピクセルまたは2048ピクセルでアップロードされた画像が600ピクセルまたは1000ピクセル幅になることもあります。

訓練された目には、品質の低下は明らかです。テクスチャの欠落、ハロ、色のグレーディングの悪さなどです。

最近のアップグレードにより、制限を満たす画像でさえシステムによる「改善」が行われ、品質が低下して圧縮されます。

「元のjpg品質を再圧縮」を調整し、再圧縮を防ぐことを期待して100%に設定しました。これは機能しているようですが、それでも再圧縮されるかどうかはわかりません(少なくとも目に見える品質の低下はありません)。

「いいね!」 1

composer media optimization image bytes optimization threshold を調整して、そのサイズ以下の画像のクライアント側サイズ最適化を無効にする必要があります。デフォルトでは500KBを超える画像に適用されるため、この設定を1.2MBに増やす必要があります。

「いいね!」 2

これらのサイト設定の説明を改善して、仕組みをより明確にするべきでしょうか? :thinking:

「いいね!」 1

そうだと思いますが、コピーライティングは私の得意分野ではありません。

現在は

クライアントサイドの最適化をトリガーする最小画像ファイルサイズ

変更後は

アップロード前にリサイズ/圧縮をトリガーする最小画像ファイルサイズ

でしょうか?

「いいね!」 2

多分

これより大きい画像はクライアントによってリサイズおよび圧縮されます

「いいね!」 4