greengo Posted November 19, 2007 Share Posted November 19, 2007 hi, I made this function that should print the width and height of all the images in a given folder but when I use the function @ImageCreateFromJpeg() it loops once and then stops. do u know y? <?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 ); $width = ImageSX($img); $height = ImageSY($img); echo $width."-".$height."</br>"; //echo $dir_photo.$file."</br>"; } } closedir($dir_photo); } createFile("photo/"); ?> Link to comment https://forums.phpfreaks.com/topic/77888-problem-with-imagecreatefromjpeg/ Share on other sites More sharing options...
Karl33to Posted November 19, 2007 Share Posted November 19, 2007 try dropping the @ off the function call, as it suppresses the error messages Link to comment https://forums.phpfreaks.com/topic/77888-problem-with-imagecreatefromjpeg/#findComment-394366 Share on other sites More sharing options...
revraz Posted November 19, 2007 Share Posted November 19, 2007 I've already told him that in his other post. I am not sure why he keeps asking the same questions when he doesn't try the advise given already. Link to comment https://forums.phpfreaks.com/topic/77888-problem-with-imagecreatefromjpeg/#findComment-394519 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.