No Code Attached Yet J4 Media Manager bug
avatar ceford
ceford
21 Apr 2022

Steps to reproduce the issue

Observe the file size of an image before doing anything to it. Size: 262kb
Select the image and invoke the Edit function. Without doing anything save and Close. Size: 375kb

Expected result

I expect the quality setting to affect file size.

Actual result

The quality setting seems to have no effect.

System information (as much as possible)

PHP 8.011 Apache/2.4.51 Joomla! 4.1.0 Stable [ Kuamini ] 15-February-2022 09:30 GMT

Additional comments

I am writing some documentation and need to know whether this feature is actually working as intended. I was surprised to see file sizes increasing signiricantly on save.

avatar ceford ceford - open - 21 Apr 2022
avatar ceford ceford - change - 21 Apr 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 21 Apr 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Apr 2022
avatar chmst
chmst - comment - 23 Apr 2022

I see the contrary - that the size of images is smaller than before after saving. But the input in Quality is not stored and remains 80.

avatar chmst chmst - change - 23 Apr 2022
Labels Added: J4 Media Manager
avatar chmst chmst - labeled - 23 Apr 2022
avatar brianteeman
brianteeman - comment - 23 Apr 2022

it will probably depend on the original compression of the image

avatar chmst
chmst - comment - 23 Apr 2022

The quality then is confusing. If I store the image without doing something - means that when saving, the qualitiy is reduced to 80. This would explain a recution of size. If I open again, do nothing and save, the quality is again reduced to 80 and so on.

avatar ceford
ceford - comment - 24 Apr 2022

Looking through the javascript code it seems that the image quality setting should be between 0 and 1. But even with a value of 0.5 the processed image is larger in bytes than the original and any value between 0 and 1 does not change the saved image size significantly. I was rather expecting the quality value to affect the compression quality. See

https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
media/plg_media-action_crop/js/crop.js (for example use of quality)

Something else I did not know: Save just writes out the image buffer to the file on disk. It does not use any of the php image manipulation functions.

All quite confusing.

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment