PHP Classes
elePHPant
Icontem

Exif Capture: Extract metadata from picture files in Exif format

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-12-31 (21 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 69 This week: 3All time: 9,300 This week: 134Up
Version License PHP version Categories
exifcapture 1.0Public Domain5PHP 5, Graphics, Files and Folders
Description Author

This package can Extract metadata from picture files in Exif format.

It can take the path of image file and parse it to extract details of the image like the width, height, software that was used to generate the image.

The class can extract the required details of the specified image and returns it as an associative array.

Recommendations

extract exif data from pictures
I need the exif data from a lot off pictures

  Performance   Level  
Name: Ray Paseur <contact>
Classes: 3 packages by
Country: United States United States
Age: 68
All time rank: 3821438 in United States United States
Week rank: 3 Up1 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

Details
Class ExifCapture

This class uses the PHP Exif extension to extract metadata from image
files.  Although PHP can recognize many kinds of image files, the Exif
extension only seems to work well with JPG and TIF files.

The Class was motivated by this need:
https://www.phpclasses.org/recommend/1119-I-need-the-exif-data-from-a-lot-off-pictures.html

References:
https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html
http://exif.org/Exif2-2.PDF
http://php.net/manual/en/ref.exif.php
http://php.net/manual/en/exif.requirements.php
 
Exif has a lot of "loose ends" shown here
https://stackoverflow.com/questions/5184748/php-bad-exif-data-warnings-what-to-do
https://bugs.php.net/bug.php?id=72819

Exif data comes in multidimensional arrays.  Which arrays are present
in any given image?  Who knows!  Consult the "SectionsFound" element.
In my experimentation the most useful information was contained in
FILE, COMPUTED, IFD0, and EXIF arrays.  Within these arrays the items
are given easy-to-understand names like "FileName" and "MimeType."

BTW, It's IFD zero, not IFD oh.

The Class provides the following methods

__construct() makes opinionated assumptions about what information
will be captured, and what unuseful information will be discarded.
You may want to modify these underlying assumptions.

set_included_array() can be used to capture other sections of the Exif.

set_required_item() can be used to limit the return to certain items.

set_excluded_item() can be used to remove items from the collection.

get_image_data() returns as much data as possible for a given image
file, subject to the constraints of the included arrays and the 
excluded items.  This can be quite a lot of information.

get_required_data() returns only the information that has been 
explicitly requested by the constructor and set_required_item().

get_image_list() creates class properties that segregate files with
Exif information from files that do not provide PHP-readable Exif.
The properties are arrays that can be iterated with foreach().

build_exif_array() finds all of the Exif values that PHP knows about.
Many (perhaps most) of these are not going to be present in your
image file. Call this method, then print the object to see them.

Some image files will have more Exif than others. After processing 
with Photoshop, some image files gain additional Exif.  Some image
editors can strip Exif, which may make the image file smaller so 
that it loads faster over the internet.

Please see the demo file for examples that use the methods.
  
Screenshots  
  • screenshot.png
  Files folder image Files  
File Role Description
Plain text file class_ExifCapture.php Class Class Source
Accessible without login Plain text file demo_ExifCapture.php Example Demonstration
Accessible without login Plain text file readme_ExifCapture.txt Doc. Readme

 Version Control Unique User Downloads Download Rankings  
 0%
Total:69
This week:3
All time:9,300
This week:134Up