PHP – Display all jpg Image Infomation


Use the following PHP function, you can display all image information (EXIF data) for a particular jpg file.

<?php
echo "aladdin-sane.jpg:<br />\n";
$exif = exif_read_data('david-bowie/aladdin-sane.jpg', 'IFD0');
echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";

$exif = exif_read_data('david-bowie/aladdin-sane.jpg', 0, true);
echo "test2.jpg:<br />\n";
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
echo "$key.$name: $val<br />\n";
}
}
?> 

Hope it helps!

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Technorati
  • Twitter
  • Yahoo! Bookmarks

  1. No comments yet.
(will not be published)