#18543 closed enhancement (fixed)
Wrap imagejpeg et al to support stream wrappers
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | scribu, adambackstrom, japh@… |
Description
The GD functions imagejpeg(), imagegif() and imagepng() do not support writing to PHP stream wrappers. This patch provides new wp_imagejpeg(), wp_imagegif(), and wp_imagepng() functions which wrap the GD functions, and a backend function _wp_imageany() which (if necessary) output buffers the image and writes to a stream URL.
A supporting function, wp_is_stream(), is used to identify paths that are stream URLs.
An alternative implementation of _wp_imageany() could write the image to a tmpfile and then copy the image to the stream URL.
Attachments (6)
Change History (13)
adambackstrom — 21 months ago
adambackstrom — 21 months ago
comment:2
adambackstrom — 21 months ago
- Cc adambackstrom added
adambackstrom — 21 months ago
Alternate using temp file rather than output buffering (recommended by dd32)
adambackstrom — 21 months ago
Bugfix output buffered version; always turn off ob before function ends (thanks, dd32)
- Milestone changed from Awaiting Review to 3.5
I would really like to see this added to 3.5, to complement our focus on the media, upload, and gallery user experience.
I think this is closely related to #6821.
comment:5
wonderboymusic — 8 months ago
- Keywords has-patch added
comment:6
markoheijnen — 8 months ago
- Resolution set to fixed
- Status changed from new to closed
Fixed in [22094]
comment:7
markoheijnen — 8 months ago
- Keywords has-patch removed

gd-imagejpeg-wrapper-ob.2.diff is a dupe, please ignore.