image.inc:
we might want to ouput image to standart buffer, so we can set destination to NULL.

Patch for 4.7 attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

doq’s picture

FileSize
352 bytes

Patch for HEAD attached.

drumm’s picture

Status: Needs review » Needs work

I don't understand what this is trying to accomplish. Please provide a more detailed description.

doq’s picture

from http://.php.net/imagejpeg :
The filename argument is optional, and if left off, the raw image stream will be output directly. To skip the filename argument in order to provide a quality argument just use an empty string ('').
Well, when I use an empty string for image_scale() etc. it doesn't print an image when I provide an empty string. Even when FALSE, NULL, 0 etc. PHP warnings are printed instead. Looks like php bug.

    * warning: imagejpeg(): Invalid filename '' in /var/www/html/htdocs/drupal/dev/includes/image.inc on line 310.

PHP Version 4.3.9 under fedora core 3.
gd
GD Support

enabled
GD Version

bundled (2.0.28 compatible)
FreeType Support

enabled
FreeType Linkage

with freetype
GIF Read Support

enabled
GIF Create Support

enabled
JPG Support

enabled
PNG Support

enabled
WBMP Support

enabled
XBM Support

enabled

killes@www.drop.org’s picture

Version: 4.7.3 » 5.x-dev

moving

Jose Reyero’s picture

Category: bug » feature

If I got it right you are talking about extending the image api to handle also writing to standard output.

/**
 * GD helper to write an image resource to a destination file.
 */
function image_gd_close($res, $destination, $extension) {

So, a pair of things:
- This is not a bug, but a feature request -the Drupal api function works just as intended but you want it to do something else
- For the patch, you need to fix also the function description and parameters

Robin Monks’s picture

Title: output image to standart output » Allow ImageAPI to output images to standard output
Version: 5.x-dev » 7.x-dev

As a rule, feature requests will not go into stable releases. Because, of this, your feature request will be moved to the 7.x development branch. If you no longer wish to work on this issue yourself, please remove yourself from the assignee field and make your intentions known in a comment.

Thanks for reporting an issue on drupal.org, your input is what makes Drupal great!
Robin Monks
Drupal.org Testing/QA

Dean Reilly’s picture

Status: Needs work » Needs review
FileSize
1.71 KB

It seems like it would be easy enough to add a function and some helper functions to the toolkits to make this possible if it's needed. I've attached a patch which should work with the gd toolkit.

Status: Needs review » Needs work

The last submitted patch, image_output.patch, failed testing.