Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Taken from Example #1 of http://php.net/manual/en/function.exif-read-data.php */
- $fn = "images/zucchini.jpg";
- $section = "ANY_TAG"; // Can be FILE, COMPUTED, ANY_TAG, IFD0, THUMBNAIL, COMMENT, or EXIF
- echo "<h1>Reading exif data from $fn</h1>";
- $exif = exif_read_data($fn, $section,true,true); // Set to break sections into subarrays and reads actual thumbnail data into $exif["THUMBNAIL"]["THUMBNAIL"].
- echo $exif === false ? "No header data found.<br/>" : "Image contains headers<br/>";
- // Dump full $exif array
- echo "<pre>";
- print_r($exif);
- echo "</pre>";
- // Perform base-64 encoding of thumbnail and display as embedded image.
- echo "<img src='data:image/jpg;base64," . base64_encode($exif["THUMBNAIL"]["THUMBNAIL"]) . "'/>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement