Hi all,
I have the following problem and a partial solution.
I have a folder - lets call it A. Within A, I have numbered folders 0-19. I have managed to open all the folders and made them ready for the rest of the operation.
I have a separate folder, called IMAGES, full of JPG's.
I need to open the IMAGES folder (okay so far), then read all the image filenames into an array (trouble brewing).
I am trying to use the following code, but get an error message -
---------------------------------------------------
if(opendir(IMAGES,$imagepath))
{
print"\nopened Converted Image folder okay\n";
}
else
{
print"\n did not open Converted Image folder";
}
while(<IMAGES>)
{
@array=<IMAGES>;
}
-----------------------------------------------------
The error is 'readline() on unopened filehandle IMAGES'
I thought I had opened the file!
I then need to check the name of each image - the name will be numeric - and depending on the result copy the image to one of the numbered folders. The checking of the name is no problem.
Any help is much appreciated - and have a Merry Christmas
I have the following problem and a partial solution.
I have a folder - lets call it A. Within A, I have numbered folders 0-19. I have managed to open all the folders and made them ready for the rest of the operation.
I have a separate folder, called IMAGES, full of JPG's.
I need to open the IMAGES folder (okay so far), then read all the image filenames into an array (trouble brewing).
I am trying to use the following code, but get an error message -
---------------------------------------------------
if(opendir(IMAGES,$imagepath))
{
print"\nopened Converted Image folder okay\n";
}
else
{
print"\n did not open Converted Image folder";
}
while(<IMAGES>)
{
@array=<IMAGES>;
}
-----------------------------------------------------
The error is 'readline() on unopened filehandle IMAGES'
I thought I had opened the file!
I then need to check the name of each image - the name will be numeric - and depending on the result copy the image to one of the numbered folders. The checking of the name is no problem.
Any help is much appreciated - and have a Merry Christmas