Skip to content

Instantly share code, notes, and snippets.

@riscos
Last active December 31, 2015 01:39
Show Gist options
  • Save riscos/7915337 to your computer and use it in GitHub Desktop.
Save riscos/7915337 to your computer and use it in GitHub Desktop.
$sourceGdImage is always FALSE.
...
$sourceGdImage = FALSE;
switch ($this->getOriginalResource()->getFileExtension()) {
case 'gif':
$sourceGdImage = imagecreatefromgif($fileTemp);
break;
case 'jpeg':
case 'jpg':
$sourceGdImage = imagecreatefromjpeg($fileTemp);
break;
case 'png':
default:
$sourceGdImage = imagecreatefrompng($fileTemp);
break;
}
// Code in this if is NEVER executed
if ($sourceGdImage !== FALSE) {
...
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment