greengo Posted November 16, 2007 Share Posted November 16, 2007 hi everyone, I have this error "1296-972" from this line "$img = @imageCreateFromJPEG( $dir_photo.$file )or die ( E_ERROR ());" does anyone know what it means? thanks Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/ Share on other sites More sharing options...
Lumio Posted November 16, 2007 Share Posted November 16, 2007 PHP is case-sensitive... so imageCreateFromJPEG is not the same as imagecreatefromjpeg. Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393097 Share on other sites More sharing options...
greengo Posted November 16, 2007 Author Share Posted November 16, 2007 nothing's changed Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393100 Share on other sites More sharing options...
revraz Posted November 16, 2007 Share Posted November 16, 2007 Functions aren't. PHP is case-sensitive... so imageCreateFromJPEG is not the same as imagecreatefromjpeg. Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393105 Share on other sites More sharing options...
revraz Posted November 16, 2007 Share Posted November 16, 2007 I've used this with success in another project $image = imagecreatefromjpeg("FSESig.jpg"); So I would try a couple of things. One, get rid of the @ so you can see if there are any other errors. Two, get rid of the space before $dir Three, try an absolute path or a jpg that is in the same folder. Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393107 Share on other sites More sharing options...
greengo Posted November 16, 2007 Author Share Posted November 16, 2007 ??????????????????? Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393108 Share on other sites More sharing options...
revraz Posted November 16, 2007 Share Posted November 16, 2007 How is my post confusing? Also, you didn't put your code on a single line did you? No need to have Quotes around it. Post the entire code before and after your $img line. Post what $dirphoto.$file equals. Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393109 Share on other sites More sharing options...
greengo Posted November 16, 2007 Author Share Posted November 16, 2007 i'm sure u did though I need to know what that error means Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393111 Share on other sites More sharing options...
revraz Posted November 16, 2007 Share Posted November 16, 2007 Can't help you if you don't provide the information I'm asking you. Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393116 Share on other sites More sharing options...
greengo Posted November 16, 2007 Author Share Posted November 16, 2007 this's the function <?php function createFile($dir_photo) { $dir = opendir($dir_photo); //List files in images directory while (($file = readdir($dir)) !== false) { $ext = substr($file,strlen($file)-3); $ext = strtolower($ext); if($ext=="jpg") { $img = @imagecreatefromjpeg( $dir_photo.$file )or die ( E_ERROR ()); $width = ImageSX($img); $height = ImageSY( $img ); echo $width."-".$height; //echo $dir_photo.$file."</br>"; } } } createFile("photo/"); ?> Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393119 Share on other sites More sharing options...
Lumio Posted November 17, 2007 Share Posted November 17, 2007 E_ERROR is not a function. It's a constant. change it to: or die("An error occured"); Link to comment https://forums.phpfreaks.com/topic/77653-imagecreatefromjpeg-error/#findComment-393398 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.