Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Steps to reproduce:
- Create an image field using s3 stream wrapper.
- Upload a file.
- Attempt to save node results in fatal.
- getimagesize call inside image_get_info tries to do a seek on the remote stream
- seeking on a remote stream isn't supported for memory reasons
- getimagesize returns false
- attempt to write image width/height values into field tables results in an sql error
Proposed resolution
Borrow from s3fs project and wrap the guzzle body object in a cached stream - which does support seeking, by reading the remote file into temporary memory
This only impacts content editors so memory impact isn't large unless you're allowing open content-creation.
Remaining tasks
Review
User interface changes
None
API changes
None
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#1 | getimagesize.patch | 2.27 KB | larowlan |
Comments
Comment #1
larowlanComment #2
larowlanDuplicate of #2494829: Fix getimagesize() failing when images require fseek