Question : PHP: Output image on die

Now my code dies with text:
1:
2:
header( "Content-type:  image/gif"); 
   $this->myImage = imagecreatefromgif($this->imgSrc) or die("Error: Cannot create image!");


However I want it to output a 1px gif image if it dies:
 
1:
2:
3:
4:
5:
6:
7:
8:
9:
<?php 

header( "Content-type:  image/gif"); 

printf ("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c% 
c%c%c%c%c%c%c%c",71,73,70,56,57,97,1,0,1,0,128,255,0,192,192,192,0,0,0,33,249,4, 
1,0,0,0,0,44,0,0,0,0,1,0,1,0,0,2,2,68,1,0,59); 

?>
Related Solutions: PHP: Output Jpeg on die

Answer : PHP: Output image on die

Sorry...
1:
2:
3:
header( "Content-type:  image/gif"); 
$error_image = sprintf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",71,73,70,56,57,97,1,0,1,0,128,255,0,192,192,192,0,0,0,33,249,4,1,0,0,0,0,44,0,0,0,0,1,0,1,0,0,2,2,68,1,0,59);
   $this->myImage = imagecreatefromgif($this->imgSrc) or die ($error_image);
Random Solutions  
 
programming4us programming4us