note 40661 added to function.getimagesize
| From: | MarioPro at rn2 dot php dot net | Date: | Wed, 10 Mar 2004 23:13:07 +0000 |
| Subject: | note 40661 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66585@lists.php.net to get a copy of this message | ||
The Problem:
I've just noticed that after upgrading to the PHP 4.3.4 version, the old GetImageSize() should
get your attention on pages coded before this new version.
The solutions:
So, if you used GetImageSize(), you should now be using getimagesize() - attention to all lower
caracters.
Also, you shou certify that the image realy exists, otherwhise you'll get the following error:
getimagesize(): Read error!
This means that there is no image to "fill" the string and thus you're calling, for
example: "images/news/" instead of calling "images/news/03102004a.jpg"
One should now verify if there is an image to be called (example):
if($photo1!=""){
$size1=getimagesize("images/news/".$photo_news_1"]);
$width1=$size1[0];
$height1=$size[1];
}
Here, if $photo_news_1 is set and exists it will be displayed, otherwhise it will be skiped and no
ERROR message will be displayed. In the PHP 4.3.3 and earlier versions, this was not necessary but
it is now! ;)
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40661
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40661&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40661&report=yes
Search -- http://master.php.net/manage/user-notes.php