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/"); ?> Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.