[ansel] Ansel and Exif.php

Heath S. Hendrickson heath at outerspaceconsultants.com
Mon Jan 19 19:55:16 PST 2004


Is there any reason that Exif.php has the elaborate code for 
read_exif_data_raw now that PHP>4.2.0 has a native function to do just 
this?  I'm guessing it's legacy, but wanted to hear first before I 
submit a patch to replace it with a call to exif_read_data.

heath

 From the online PHP manual.


  exif_read_data

(PHP 4 >= 4.2.0)

exif_read_data -- Reads the EXIF headers from JPEG or TIFF. This way you 
can read meta data generated by digital cameras.


    Description

array *exif_read_data* ( string filename [, string sections [, bool 
arrays [, bool thumbnail]]])

The *exif_read_data()* function reads the EXIF headers from a JPEG or 
TIFF image file. It returns an associative array where the indexes are 
the header names and the values are the values associated with those 
headers. If no data can be returned the result is *FALSE*.

/filename/ is the name of the file to read. This cannot be an url.

/sections/ is a comma separated list of sections that need to be present 
in file to produce a result array. If none of the requested sections 
could be found the return value is *FALSE*.

FILE 	FileName, FileSize, FileDateTime, SectionsFound
COMPUTED 	html, Width, Height, IsColor and some more if available.
ANY_TAG 	Any information that has a Tag e.g. IFD0, EXIF, ...
IFD0 	All tagged data of IFD0. In normal imagefiles this contains image 
size and so forth.
THUMBNAIL 	A file is supposed to contain a thumbnail if it has a second 
IFD. All tagged information about the embedded thumbnail is stored in 
this section.
COMMENT 	Comment headers of JPEG images.
EXIF 	The EXIF section is a sub section of IFD0. It contains more 
detailed information about an image. Most of these entries are digital 
camera related.

/arrays/ specifies whether or not each section becomes an array. The 
sections /COMPUTED/, /THUMBNAIL/ and /COMMENT/ allways become arrays as 
they may contain values whose names are conflict with other sections.

/thumbnail/ whether or not to read the thumbnail itself and not only its 
tagged data.

    *Note: * Exif headers tend to be present in JPEG/TIFF images
    generated by digital cameras, but unfortunately each digital camera
    maker has a different idea of how to actually tag their images, so
    you can't always rely on a specific Exif header being present.

    Windows ME/XP both can wipe the Exif headers when connecting to a
    camera. More information available at
    http://ww2.canon-europe.com/products/cameras/notices_dig_cam_users.html.





More information about the ansel mailing list