note 28008 added to ref.image
| From: | Enrique at rack1 dot php dot net | Date: | Sun, 29 Dec 2002 17:32:10 +0000 |
| Subject: | note 28008 added to ref.image | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41424@lists.php.net to get a copy of this message | ||
I'm trying to upload a PNG file, but the simple switch case IMG_PNG doesn't function.
Then viewing the code returned I get:
array(6) {
[0]=>
int(1599)
[1]=>
int(816)
[2]=>
int(3)
[3]=>
string(25) "width="1599" height="816""
["bits"]=>
int(8)
["mime"]=>
string(9) "image/png"
}
And
jpeg = 2, gif = 1, wbmp = 8, jpg = 2, png = 4, xpm = 16
So, what is 3 ($imageinfo[2]) ?
Then I write the case with:
switch($imageinfo[2]) {
case IMG_GIF + IMG_JPG:
case IMG_PNG:
$im = @imagecreatefrompng($_FILES['picture']['tmp_name']);
break;
}
The image was loaded and all the gd code work ok...
--
http://www.php.net/manual/en/ref.image.php
http://master.php.net/manage/user-notes.php?action=edit+28008
http://master.php.net/manage/user-notes.php?action=delete+28008
http://master.php.net/manage/user-notes.php?action=reject+28008