note 47366 added to function.getimagesize
| From: | GeoffVane at osu1 dot php dot net | Date: | Sat, 13 Nov 2004 18:39:24 +0000 |
| Subject: | note 47366 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-80472@lists.php.net to get a copy of this message | ||
WARNING:
I couldn't get getimagesize() to work when using certain arrays.
The solution was simple but easily overlooked:
When using an array and/or a .txt file,
to store & extract an image filename,
which getimagesize() should examine,
an almost unnoticable and unwanted space can exist !!!
(at the end of the string..)
Use rtrim($yourfilenamestring) to get rid of the space
that will block your getimagesize() operation.
example:
$a = getimagesize(rtrim($yourfilenamestring) ) ;
$a[0] will contain the width
$a[1] will contain the height
:)
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47366
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47366&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47366&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47366&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47366&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47366&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47366&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47366&report=yes
Search -- http://master.php.net/manage/user-notes.php