Re: exif_imagetype and constant confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



eric cash escreveu:
Stupid question time!  I can't find my answer anywhere, sorry about this...

The nature of the return value of exif_imagetype() is baffling me. The php manual uses one simple example like this:

<code>
   <?php
if (exif_imagetype('image.gif') != IMAGETYPE_GIF) {
   echo 'The picture is not a gif';
}
?>

</code>

okay, cool. the return value is the constant IMAGETYPE_GIF. of course if you do something like this:
<code>
$foo = exif_imagetype('image.jpg');
echo $foo;
</code>

you'll echo out 2.

Great, seems really useful to me. What am I missing? Why is the value of the IMAGETYPE_XXX constants an integer, for one thing, and not a string like 'gif' or 'jpg'? And how do I access some sort of usable string telling me the type of image without having to do something retarded like putting a bunch of strings in a numerically indexed array (which will be completely confusing later when I try to figure it out). And thirdly, what the !?#@ am I missing here? I feel like an idiot, but it makes no sense to me that an 'imagetype' function would return something that evaluates to an integer.

Please help, my head hurts.

Thanks

ec
---------------------------------------------------------
http://www.educar.pro.br/i_en/php/exif/
---

--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
----------------------------------------------------------	
You must hear, always, one second opinion! In all cases.
----------------------------------------------------------
Let the people know if this info was useful for you!
----------------------------------------------------------

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux