Jump to content

problem with @ImageCreateFromJpeg()


greengo

Recommended Posts

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

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.