Using PHP\'s Image and GD functions you can use the following method to finally output the php image
imagepng($image);
Sometimes, for whate
What you want to do is catch PHP errors, not detect a "blank image". You can use set_error_handler() to define a custom callback that's called when an error occurs.
Things such as parse errors are something you should debug before publishing your code, but this should help you detect random errors (database connections dying, whatnot).