[wp-trac] [WordPress Trac] #64411: Media Library - Large Image Size Uploads
WordPress Trac
noreply at wordpress.org
Tue Dec 16 03:40:39 UTC 2025
#64411: Media Library - Large Image Size Uploads
-------------------------+------------------------------
Reporter: irgordon | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 6.9
Severity: normal | Resolution:
Keywords: | Focuses: performance
-------------------------+------------------------------
Comment (by irgordon):
The primary benefit of enforcing chunking is bypassing restrictive
upload_max_filesize limits on shared hosting without requiring users to
edit php.ini. It also improves reliability on unstable mobile networks
(resumability).
However, the downsides are typically server-side aggressive WAFs
(ModSecurity) blocking rapid POST requests, and the need for garbage
collection of orphaned chunks if an upload is abandoned.
Agreed that the filter exists for developers. However, our suggestion was
aimed at UX resilience: automatically detecting if the environment has
insufficient memory to handle the scaling operation and dynamically
bypassing the threshold for that specific upload.
Currently, the process simply fatal errors or hangs, leaving the user
confused. We are suggesting a 'fail-safe' where if the resize fails or is
predicted to fail (memory check), WP skips the scaling and keeps the
original, rather than terminating the upload entirely.
That clarifies the prioritization, thank you. The suggestion might be
better phrased as adding a memory-check guardrail for GD specifically.
Since GD uncompresses the entire image into RAM (bitmap) to process it, it
is the most common cause of a blank screen during uploads on overburdened
servers. If Imagick is unavailable, could we check memory_get_usage()
against the estimated memory needed for the image dimensions before
attempting the GD operation? If it's going to crash, we could skip the
resize (similar to the big_image_size_threshold logic) rather than
crashing the process.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64411#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list