Guest kilbad Posted January 5, 2007 Share Posted January 5, 2007 Here are my questions: I have a picture on a webpage, and I want to echo one of its EXIF data fields below it (i.e. Title, Subject, Author, or maybe Comments, etc.). How would I go about echoing a single EXIF data field for an image? Also, what are all the different avalible EXIF data fields that a JPG can have?Thank you all so much in advance!Brendan Quote Link to comment https://forums.phpfreaks.com/topic/32921-solved-exif-data-what-are-all-the-different-fields-and-how-to-echo/ Share on other sites More sharing options...
kenrbnsn Posted January 5, 2007 Share Posted January 5, 2007 Use the [url=http://www.php.net/exif_read_data]exif_read_data()[/url] function to extract the data.Experiment first to see how this function returns the data:[code]<?php$exif_data = exif_read_data('picture.jpg');echo '<pre>' . print_r($exif_data,true) . '</pre>';?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/32921-solved-exif-data-what-are-all-the-different-fields-and-how-to-echo/#findComment-153261 Share on other sites More sharing options...
Guest kilbad Posted January 5, 2007 Share Posted January 5, 2007 That function works perfectly to display the EXIF data! ThanksNow, how do I echo/print just a single EXIF field (like title for example)?[you can see the output of that function at [url=http://kilbad.com/DEVELOPMENT/test.php]http://kilbad.com/DEVELOPMENT/test.php[/url]]Thanks again for all the help! Quote Link to comment https://forums.phpfreaks.com/topic/32921-solved-exif-data-what-are-all-the-different-fields-and-how-to-echo/#findComment-153568 Share on other sites More sharing options...
kenrbnsn Posted January 5, 2007 Share Posted January 5, 2007 Assuming you used my example, just add the appropriate echo statement:[code]<?php$exif_data = exif_read_data('picture.jpg');echo $exif_data['Title'];?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/32921-solved-exif-data-what-are-all-the-different-fields-and-how-to-echo/#findComment-153570 Share on other sites More sharing options...
Guest kilbad Posted January 5, 2007 Share Posted January 5, 2007 That works perfectly.. thank you so much! Quote Link to comment https://forums.phpfreaks.com/topic/32921-solved-exif-data-what-are-all-the-different-fields-and-how-to-echo/#findComment-153575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.