Re: imagesx(): supplied argument is not a valid Image resource (CODE)
| From: | Richard Lynch | Date: | Wed, 01 Dec 2004 21:13:54 +0000 |
| Subject: | Re: imagesx(): supplied argument is not a valid Image resource (CODE) | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203269@lists.php.net to get a copy of this message | ||
Robert Sossomon wrote:
> Chris is quoted as saying on 11/30/2004 2:53 PM:
>> imagesx() requires an image resource , not a file path. so you'd need
>> to use one of the imagecreatefrom* functions to create the resource.
>>
>> But it looks like all you want is the width and height of an image....
>> If so use get imagesize() ( which *does* except a pathname, not a
>> resource)
>>
>> Chris
>>
>> http://www.php.net/image
>> http://www.php.net/getimagesize
> <SNIP>
> I had looked at get image size, but thought the other would be quicker...
> ARGH.
imagesx() is probably quicker once you have loaded in the entire image to
your GD resource...
But assuming the image could be *HUGE* and that getimagesize only has to
read the first N bytes to determine the size of the image, getimagesize
will win any speed race for an otherwise un-opened image file, I should
think.
--
Like Music?
http://l-i-e.com/artists.htm