Wrap imagejpeg et al to support stream wrappers
|Reported by:||adambackstrom||Owned by:|
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.