Forum
Image resize on new assets module
I have set a width attribute on a perch image tag, to have perch scale down any images uploaded over that width (800px in this case). It doesn't seem to be resizing the image. They are still coming out full size (or in this case, throwing me a white page when I save the region). The image in the resource folder is still 4000px wide and 2mb in size.
My template code
Can you show me your diagnostics report?
If the image is 4000px wide, you could be hitting up against memory limits resizing it, although I'd be surprised. Can you confirm you're uploading the image and then actually using it in that region? The image is resized when it's used.
Yeah, I upload the image, via the region. Then select it, it registers in the field on the admin panel. Then when I save the region I get a white page, presumably silently throwing errors. Is there any way to show these errors?
The errors will be in your PHP error log.
https://solutions.grabaperch.com/development/why-am-i-getting-a-blank-page
So it is 9mb, but it's decompressing to larger than 64Mb
File size and amount of memory required to manipulate an image aren't necessarily linked. Looks like you'll need to allow more memory if you want to manipulate images of that size and colour depth.
Not a chance of that on shared hosting unfortunately. We will just have to make sure the client doesn't upload anything too big. Is there any way to set a max filesize on an image field, so the client sees an understandable error
The file size doesn't directly correlate to the memory needed, so that's not necessarily a great solution.
Yeah true. Ah well. We will just have to make sure the client isn't adding huge images in the first place. Thanks Drew.
Or just pony up a bit for some suitable hosting! :)