Hi
I have a standard server action which uploads and image, repeats the load, then resize, then saves.
All works as expected on my desktop browser.
If I try the same thing on my iphone, the image loads OK but all the other steps fail. The only difference I can see is the image on the PC has a jpg extension and the image uploaded via the iPhone has jpeg extension.
Anyone had a similar problem and found a solution?
CK
Have you got your iPhone set to save as HEIC? I guess not if you’re sure it’s saving as .jpeg
Have you tried uploading a .jpeg on your PC to confirm it’s the extension that’s the issue? I’ve not had any problems with either jpg or jpeg.
You could also copy the image from your phone to your PC and then upload it so you can see the errors in the dev console.
Teodor
August 26, 2025, 4:21pm
3
Can you check your server logs for errors? Also does the same thing happen if you get your iphone image and upload it from the computer?
Hi Teodor,
Its not the file extension thats causing the error, its a php memory shortage;
[Tue Aug 26 16:41:08.669753 2025] [proxy_fcgi:error] [pid 132364:tid 139963186280000] [client 146.75.168.54:0] AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/vhosts/mydomain.com/httpdocs/dmxConnectLib/lib/image/Processor.php on line 326', referer: https://mydomain.com/update.php?id=545
134217728 bytes (134mb) seems a lot to process a jpeg of 4.3mb in size
changed php.ini to 512mb and it now works OK…
Teodor
August 26, 2025, 5:03pm
5
What are the exact server action steps in your server action?
Teodor
August 27, 2025, 8:56am
7
Image manipulations take a lot of memory especially with the several resize steps you have in the server action. See:
The filesize doesn’t say anything about the size a image takes in memory. The file gets stored uncompressed in memory, standard formula is width * height * 4 (every pixel takes 4bits (RGBA) in memory). You need more then just the image data if you are going to manipulate it.
Thank you for your guidance
Mozzi
August 28, 2025, 7:53am
9
I would also recommend on your “file upload” field to set the size beforehand. So that you resizes before you upload. This will help if you uploading from a iphone in hdr… instead of uploading a 4.3mb.. it will resize it …
<input id="file1" name="file1" type="file" image-max-width="1200" image-quality="80">
Go see
Intro
Client side image resize allows you to resize images on the client side before uploading them. Simply set the maximum width, height, quality, and target image type directly in the file input controls or the dropzone component. This ensures that your images are resized automatically before being uploaded, reducing upload times and saving bandwidth. You can even convert images to formats like WebP, with optional resizing, for more efficient storage and faster loading times.
Image Resize O…
1 Like