كيفية تجنب أي نوع من إعادة الضغط على الصور؟

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.2 ميجابايت وحدًا أقصى للدقة يبلغ 4 ميجابكسل.

عندما لا تتوافق الصورة مع هذا الحد، يقوم النظام بضغطها بشدة، وأحيانًا بنتائج جنونية مثل 600 بكسل أو 1000 بكسل عرضًا لصورة تم تحميلها بعرض 1920 أو 2048 بكسل.
الفقد في الجودة واضح جدًا للعين المدربة: فقدان الأنسجة، الهالات، سوء تدرج الألوان…

مع الترقيات الأخيرة، حتى الصور التي تتوافق مع الحدود تحصل على “تحسين” للنظام ويتم ضغطها مع فقدان الجودة.

لقد قمنا بضبط “جودة إعادة ضغط ملف JPG الأصلي” وضبطها على 100٪ على أمل منع إعادة الضغط. يبدو أن هذا يعمل، لكنني لست متأكدًا مما إذا كان يتم إعادة الضغط على أي حال (ولكن على الأقل لا يوجد فقدان ملحوظ في الجودة).

إعجاب واحد (1)

تحتاج إلى تعديل composer media optimization image bytes optimization threshold لتعطيل تحسين حجم العميل للصور التي تقل عن هذا الحجم. الافتراضي ينطبق على الصور التي تزيد عن 500 كيلوبايت، لذا تريد زيادة هذا الإعداد إلى 1.2 ميجابايت.

إعجابَين (2)

هل يجب علينا تحسين وصف إعدادات الموقع هذه لجعله أوضح كيف تعمل الأشياء؟ :thinking:

إعجاب واحد (1)

أعتقد ذلك، لكن كتابة النصوص ليست من اختصاصي.

حالياً هو

الحد الأدنى لحجم ملف الصورة لتشغيل التحسين من جانب العميل

ربما

الحد الأدنى لحجم ملف الصورة لتشغيل تغيير الحجم / الضغط قبل التحميل

؟

إعجابَين (2)

ربما

سيتم تغيير حجم الصور الأكبر من هذا وضغطها بواسطة العميل

4 إعجابات