-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x] Media Cache thumbnails #43272
Comments
It kind of expected, for PNG. In theory we can try to play with higher compression, but still, in some cases PNG can be bigger. |
How can it be expected to reduce the dimensions of a png and yet the filesize increases by 300% That completely defeats the objective of the thumbnail creation /me doesnt understand how it is not a bug - please can you explain |
It is PHP side (PHP GD), not Joomla.
Depend from amount of detail the image have, it can happen for PNG in any application, not only PHP |
As the purpose of creating the thumbnail is to crerate a fast loading version of the image and this thumbnail will only be displayed in the media manager why not always set the compression to the maximum. Otherwise any png that has been optimised before uploading to joomla will generate a larger file when resized |
The code exists already to select the image quality. Its just not used at all so the compression defaults to 0 :( |
It a bit tricky, PNG have a range -1 ... 9, JPG -1 .. 100. I just can't say how much it will really help. For cases when User upload "optimised PNG", the thumbnail still may be bigger after PHP processing.
Well, it is more for really large (resolution) images , for images with small resolutions it probably irrelevant |
I did a quick manual try with PNG set to 9 and the difference was amazing. Our code supports different settings for jpg and png compression/quality it's just not being used for the thumbs |
@brianteeman although the Image class supports different compression ratios the functionality for the thumbnails doesn't expose it:
joomla-cms/libraries/src/Image/Image.php Line 319 in 45adb61
I did the implementation for the thumbnails so I guess this is my fault, if you need to blame somebody |
not interested in blame - just interested in making the thumbs functionality work as intended. I am certain you didnt intent to make the thumbnails bigger than the original ;) |
If you still have the test site available could you try adding:
Should do the trick |
surely that just disabled the creation of thumbnails ?? |
The docs say that this controls the quality: joomla-cms/libraries/src/Image/Image.php Lines 1124 to 1133 in 45adb61
|
my bad - i will test that soon |
all that does is to create reall bad quality thumbnails that are the same filesize as the good ones
|
@brianteeman check #43282 |
please test #43282 |
Steps to reproduce the issue
Add some png and jpg images to the /images folder
Go to the Filesystem local plugin and enable cache
Compare the file sizes in /images and /media/cache/com_media/thumbs
Expected result
ALL the files in the cache have been reduced in both dimension and filesize
Actual result
All the file dimensions have been reduced but the filesize has in some cases increased
System information (as much as possible)
I have prepared a zip containing 5 images so that we can compare with the same image
Test Images
test.zip
Comments
I appreciate that the original images might have been saved with different compression algorithms and ratios. These are just a random selection of images on my hdd.
In all cases the file has been reduced in dimensions so at the very least it would be reasonable to assume that its a bug if the reduced file is double the storage size of the original
The text was updated successfully, but these errors were encountered: