Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

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

Open
dbennett455 opened this issue Jan 19, 2010 · 0 comments
Open

Comments

@dbennett455
Copy link

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;
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant