RE: [PHP] using GetImageSize in a directory of images

2001-07-11 Thread Matthew Loff


(This is assuming you'll have all images in the directory, and no other
file types...)

$directory = opendir("./");

$dirEntry = readdir($directory);  // Skip "."
$dirEntry = readdir($directory);  // Skip ".."

while($dirEntry = readdir($directory))
{
// GetImageSize Code for Each $dirEntry Goes Here
}

closedir($directory);


If you may have other types of files besides images, you could easily
check each filename with strstr() or a regex.


-Original Message-
From: Rory O'Connor [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 3:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] using GetImageSize in a directory of images


recent posts introduced me to the handy GetImageSize, and it's just what
I need!  What I want to do is write a script that will go through a
directory of images and write [image name];[image dimensions] to a file
so I can query that into my products database for dynamic use on my
site.

BUT, i'm a super-duper PHP newbie and i'm unfamiliar with the syntax for
looping thru all fils in a given directory.  Can anyone point me in the
right direction?  

Thanks so much!



providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] using GetImageSize in a directory of images

2001-07-11 Thread scott [gts]

try this:

$files = opendir($dir) or die("Cannot opendir $dir");
while ($file = readdir($files)) {
// do whatever
}


> -Original Message-
> From: Rory O'Connor [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] using GetImageSize in a directory of images
> 
> 
> recent posts introduced me to the handy GetImageSize, and it's just what
> I need!  What I want to do is write a script that will go through a
> directory of images and write [image name];[image dimensions] to a file
> so I can query that into my products database for dynamic use on my
> site.
> 
> BUT, i'm a super-duper PHP newbie and i'm unfamiliar with the syntax for
> looping thru all fils in a given directory.  Can anyone point me in the
> right direction?  
> 
> Thanks so much!
> 
> 
> 
> providing the finest in midget technology
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] using GetImageSize in a directory of images

2001-07-11 Thread Rory O'Connor

recent posts introduced me to the handy GetImageSize, and it's just what
I need!  What I want to do is write a script that will go through a
directory of images and write [image name];[image dimensions] to a file
so I can query that into my products database for dynamic use on my
site.

BUT, i'm a super-duper PHP newbie and i'm unfamiliar with the syntax for
looping thru all fils in a given directory.  Can anyone point me in the
right direction?  

Thanks so much!



providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]