I have a files section to upload images. Some of the ones uploaded by the editor have been very big, around 9.000 x 5.000px and 2.5MB size. They have been told already that the images should be smaller but I tried to use srcsets to decrease the image size.
I realized the page size in the frontend is not decreasing, downloading a huge amount of assets. Every image has almost the same original size of 2.5MB.
I tried many different things in case it is not picking up the correct images but seems like that is working. Then I checked the media folder and the images are there followed by their corresponding extension regarding the quality and width but looked at their specs they seem to be identical.
I am not sure if this is the normal srcset behavior and it is not a good option to reduce the file size of an image but I al also surprised the generated images are the same resolution.
Is gd enabled on your server? Check with phpinfo().
If yes, check if you get any error messages in your server error or php error logs.
I’m not sure if there is a limit to what files sizes gd can handle.
It might be worth checking if normal size images are resized correctly.
On a side note:
It might be worth noting that unless you use full-width images only, srcset must always be accompanied by a sizes attribute, otherwise the wrong image sizes will be chosen. See also:
In the phpinfo() was enabled.
Then I checked the error logs and I found several errors like this:
[06-Sep-2022 13:18:33 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /Applications/MAMP/htdocs/websitename/kirby/vendor/filp/whoops/src/Whoops/Util/Misc.php on line 1
That means the size of the images is too big for the server memory to handle that image scaling process?
That might well be. If you can install ImageMagick or if it is available, I’d switch to that, more performant. You might have to check your memory settings as well.