getimagesize() warning

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kumarsena
Forum Newbie
Posts: 18
Joined: Mon Oct 20, 2003 7:18 am
Contact:

getimagesize() warning

Post by kumarsena »

hey,

i ahve a problem with a image gallaery script using getimagesze()

there are six pics in the folder. but only five warnings are printed.
also there is nothing wrong wth file permission, the fiels are all proper jpg and the path is correct as well, cause after the error mesages the pics are actually loaded. so it is confusing me alot, being a beginner ith php.

any help would be apreciated.
thanks
kumar



i have the following code

// loop through array and print each line

foreach ($data as $line)

{

// get image details

list($width, $height, $type, $attr) = getimagesize("thumb/$line");


echo "<td>";
echo "<img src=\"thumb/$line\" $attr >";
echo "</td>";
$row =$row + 1;

if ( $row == 4 ) {

echo "</tr> <tr>";
$row = 0;

}

}

this should in theory work, but im getting the following warning



Warning: getimagesize: Unable to open 'thumb/ash_n_guitar.jpg ' for reading. in /mnt/home2/k/ku/kumar/public_html/PHPphotoAlbum/index.php3 on line 48

Warning: getimagesize: Unable to open 'thumb/brothers.jpg ' for reading. in /mnt/home2/k/ku/kumar/public_html/PHPphotoAlbum/index.php3 on line 48

Warning: getimagesize: Unable to open 'thumb/buddies.jpg ' for reading. in /mnt/home2/k/ku/kumar/public_html/PHPphotoAlbum/index.php3 on line 48

Warning: getimagesize: Unable to open 'thumb/clubbing_boys.jpg ' for reading. in /mnt/home2/k/ku/kumar/public_html/PHPphotoAlbum/index.php3 on line 48


Warning: getimagesize: Unable to open 'thumb/clubbing_friends.jpg ' for reading. in /mnt/home2/k/ku/kumar/public_html/PHPphotoAlbum/index.php3 on line 48
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It can't open the files - it can't find them. If the relative path is correct, try setting the absolute path to see if that is any better.

Mac
kumarsena
Forum Newbie
Posts: 18
Joined: Mon Oct 20, 2003 7:18 am
Contact:

Post by kumarsena »

i have tried that as well now, still sme problem...this is drving me nuts..
can i email someone the whole code to look at, please..........?

thanks
kumar
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

[big_search]php gd getimagesize[/big_search]
Post Reply