Re: imagesx(): supplied argument is not a valid Image resource (CODE)
| From: | Robert Sossomon | Date: | Tue, 30 Nov 2004 20:14:44 +0000 |
| Subject: | Re: imagesx(): supplied argument is not a valid Image resource (CODE) | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203176@lists.php.net to get a copy of this message | ||
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. $a=getimagesize($path); $width = $a[0]; $width = $width/2; $height = $a[1]; $height = $height/2; works!! -- Robert Sossomon, Business and Technology Application Technician 4-H Youth Development Department 200 Ricks Hall, Campus Box 7606 N.C. State University Raleigh NC 27695-7606 Phone: 919/515-8474 Fax: 919/515-7812 robert_sossomon@ncsu.edu