- February 15, 2007
- Categories: EXIF, XMP and Other Meta-Data, PHP
EXchangeable Image file Format. EXIF data is data that is automatically stored with most pictures taken on today's digital camera's. In most programming languages there are way's to extract this information. In PHP you can use some of the built in EXIF functions, however this requires that exif-support is enabled. http://uk2.php.net/exif, but the trouble is it doesn't really return much useful information, most of the information you could retrieve anyway using some of PHP's Image Functions.
So I then began scraping around the Internet looking for some suitable code for extracting more data than the built in PHP functions would give me and came across a PHP library called Exifer 1.5 by Jack Olefsky, this is a very comprehensive library able to extract an amazing array of EXIF data using one simple function call.
<?php
include('/inc/exif_reader/exif.php');
$path = SERVERPATH."/albums/".$album."/".$image;
$verbose = 0;
$result = read_exif_data_raw($path,$verbose);
print_r($result);
?>
This library will return a complete multi-dimensioned array allowing you to simply pick out the information you want.
<?php echo $result['SubIFD']['MakerNote']['Settings 1']['ExposureMode']; ?>
So if you fancy playing around with EXIF in PHP I'd seriously recommend starting with this PHP library.