#18543 closed enhancement (fixed)
Wrap imagejpeg et al to support stream wrappers
| Reported by: | adambackstrom | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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)
@
15 years ago
Bugfix output buffered version; always turn off ob before function ends (thanks, dd32)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
gd-imagejpeg-wrapper-ob.2.diffis a dupe, please ignore.