|
|
|
Reads the EXIF headers from JPEG or TIFF
exif_read_data (PHP 4 >= 4.2.0, PHP 5) exif_read_data — Reads the EXIF headers from JPEG or TIFF Description array exif_read_data ( string $filename [, string $sections= NULL [, bool $arrays= false [, bool $thumbnail= false ]]] ) 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. Height and Width are computed the same way getimagesize() does so their values must not be part of any header returned. Also, html is a height/width text string to be used inside normal HTML. When an Exif header contains a Copyright note, this itself can contain two values. As the solution is inconsistent in the Exif 2.10 standard, the COMPUTED section will return both entries Copyright.Photographer and Copyright.Editor while the IFD0 sections contains the byte array with the NULL character that splits both entries. Or just the first entry if the datatype was wrong (normal behaviour of Exif). The COMPUTED will also contain the entry Copyright which is either the original copyright string, or a comma separated list of the photo and editor copyright. The tag UserComment has the same problem as the Copyright tag. It can store two values. First the encoding used, and second the value itself. If so the IFD section only contains the encoding or a byte array. The COMPUTED section will store both in the entries UserCommentEncoding and UserComment. The entry UserComment is available in both cases so it should be used in preference to the value in IFD0 section. exif_read_data() also validates EXIF data tags according to the EXIF specification (» http://exif.org/Exif2-2.PDF, page 20). Note: Windows ME/XP can both wipe the Exif headers when connecting to a camera. More information available at » http://www.canon.co.jp/Imaging/NOTICE/011214-e.html. Parameters - filename
-
The name of the image file being 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. - arrays
-
Specifies whether or not each section becomes an array. The sections COMPUTED, THUMBNAIL, and COMMENT always become arrays as they may contain values whose names conflict with other sections. - thumbnail
-
When set to TRUE the thumbnail itself is read. Otherwise, only the tagged data is read. Return Values It returns an associative array where the array indexes are the header names and the array values are the values associated with those headers. If no data can be returned, exif_read_data() will return FALSE. Examples Example #1 exif_read_data() example <?php echo "test1.jpg:<br />\n"; $exif = exif_read_data('tests/test1.jpg', 'IFD0'); echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
$exif = exif_read_data('tests/test2.jpg', 0, true); echo "test2.jpg:<br />\n"; foreach ($exif as $key => $section) { foreach ($section as $name => $val) { echo "$key.$name: $val<br />\n"; } } ?> The first call fails because the image has no header information. The above example will output something similar to: test1.jpg: No header data found. test2.jpg: FILE.FileName: test2.jpg FILE.FileDateTime: 1017666176 FILE.FileSize: 1240 FILE.FileType: 2 FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENT COMPUTED.html: width="1" height="1" COMPUTED.Height: 1 COMPUTED.Width: 1 COMPUTED.IsColor: 1 COMPUTED.ByteOrderMotorola: 1 COMPUTED.UserComment: Exif test image. COMPUTED.UserCommentEncoding: ASCII COMPUTED.Copyright: Photo (c) M.Boerger, Edited by M.Boerger. COMPUTED.Copyright.Photographer: Photo (c) M.Boerger COMPUTED.Copyright.Editor: Edited by M.Boerger. IFD0.Copyright: Photo (c) M.Boerger IFD0.UserComment: ASCII THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.JPEGInterchangeFormatLength: 523 COMMENT.0: Comment #1. COMMENT.1: Comment #2. COMMENT.2: Comment #3end THUMBNAIL.JPEGInterchangeFormat: 134 THUMBNAIL.Thumbnail.Height: 1 THUMBNAIL.Thumbnail.Height: 1 |
| TheShops Ready ver 1.51 - a free NetShops Affiliates Datafeed Site Script Categories : PHP, Ecommerce, Complete Programs | | | Microsoft DBX file reader DEMO /such as Outlook Express Mailbox database files/ Categories : Email, PHP Classes, PHP | | | How to thread a list of messages in database
and show it in a treelike structure Categories : PHP, MySQL, Databases | |
| | A PHP Script that shows how to use FTP to run a shell script, read two local files and update data in a database. Categories : PHP, Filesystem, FTP, Date Time, Databases | | | Finds the median in an array of numbers - Can be used with a MySql database column read into an array Categories : PHP, Arrays, Databases, MySQL | | | Tired to edit forms? this simple script will edit or update ANY MySQL database.It can handle set, enum, textarea and creat and update date fields
data. Categories : MySQL, Databases, PHP | | | Invision Forums Latest Threads list Categories : PHP, Miscellaneous, Databases, MySQL | | | MSSql limitations regarding length of tables, columns, databases.. Categories : MS SQL Server, Databases | | | GetCombo
Combo-BOX - Abstraction With function you can retrieve the combo-box structure with its data. Categories : PHP, HTML and PHP | | | Multi-table database search for your WAP-enabled device. Uses PHP and MySQL. No WMLscript. Categories : WAP, WML, PHP, MySQL | | | Functions to read a template file and fill in PHP variables. It will also fill in array variables, displaying parts of the template multiple times.
Categories : PHP, Variables, Filesystem | | | Smart Counter - This little script is a plain and simple hit counter that uses cookies to determine whether or not the visitor has already been counted. Categories : Cookies, HTML and PHP, PHP | | | Read a file with strings and create a new file with the
first half of each string Categories : PHP, Strings, Filesystem | | | A database abstraction layer for the PHP 3.0 ODBC module. It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface. Categories : Databases, PHP, Complete Programs | |
|
| |