smart_resize_image icon indicating copy to clipboard operation
smart_resize_image copied to clipboard

PHP 5.1.6 w/ GD 2.0.28 does not like NULL 2nd param to imagejpeg

Open dbennett455 opened this issue 16 years ago • 0 comments

I get an error when the second parameter passed to imagejpeg is NULL.

Unable to open '' for writing in ...

I worked around the issue by changing the switch statement at the bottom:

{

Writing image according to type to the output destination

switch ( $info[2] ) { case IMAGETYPE_GIF: ($output == NULL) ? imagegif($image_resized) : imagegif($image_resized, $output); break; case IMAGETYPE_JPEG: ($output == NULL) ? imagejpeg($image_resized) : imagejpeg($image_resized, $output); break; case IMAGETYPE_PNG: ($output == NULL) ? imagepng($image_resized) : imagepng($image_resized, $output); break; default: return false; } }

dbennett455 avatar Jan 19 '10 22:01 dbennett455