Jump to content

[SOLVED] error checking for imagecreatefromjpeg()


acctman

Recommended Posts

I'm receiving the following two errors. I understand why i'm receiving the errors, (file is no longer available on server). How do I prevent my script from writing an error to the log?

 

PHP Warning:  imagecreatefromjpeg(/2005/04/2946/imgExp/imgTmb/2946-101007.jpg) [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

in /files/pvtexp.php on line 38

PHP Warning:  imagejpeg(): supplied argument is not a valid Image resource in /files/pvtexp.php on line 46

 

header("Content-type: image/jpeg");
if ($_GET['tmb'] == 1) {
$im = imagecreatefromjpeg('/'.$date.'/'.$mid.'/'.$type.'/imgTmb/'.$mid.'-'.$iid.'.jpg');
	} else {
$im = imagecreatefromjpeg('/'.$date.'/'.$mid.'/'.$type.'/'.$mid.'-'.$iid.'.jpg');		
}
imagejpeg($im);
imagedestroy($im);	

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.