EXIF Headers from a JPEG

Reading EXIF Headers from a JPEG

<?php
$data = exif_read_data(dirname(__FILE__) . '/image.jpg'); 
foreach($data as $key=>$val) {
    if (is_array($val)) {
        foreach($val as $k=>$v) {
            echo $key."[$k]: $v<br />\n";
        }
    } else {
        echo "$key: ".htmlspecialchars($val)."<br />\n";
    }
}
?>

Output

FileName: image.jpg
FileDateTime: 1421836967
FileSize: 1531318
FileType: 2
MimeType: image/jpeg
SectionsFound: ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP
COMPUTED[html]: width="2400" height="1600"
COMPUTED[Height]: 1600
COMPUTED[Width]: 2400
COMPUTED[IsColor]: 1
COMPUTED[ByteOrderMotorola]: 0
COMPUTED[ApertureFNumber]: f/4.8
COMPUTED[Thumbnail.FileType]: 2
COMPUTED[Thumbnail.MimeType]: image/jpeg
ImageDescription: TOSHIBA Exif JPEG
Make: TOSHIBA
Model: PDR-4300 
Orientation: 1
XResolution: 72/1
YResolution: 72/1
ResolutionUnit: 2
Software: PDR-4300 Ver1.03 
DateTime: 2004:01:18 13:16:30
YCbCrPositioning: 2
Exif_IFD_Pointer: 246
THUMBNAIL[Compression]: 6
THUMBNAIL[Orientation]: 1
THUMBNAIL[XResolution]: 72/1
THUMBNAIL[YResolution]: 72/1
THUMBNAIL[ResolutionUnit]: 2
THUMBNAIL[JPEGInterchangeFormat]: 852
THUMBNAIL[JPEGInterchangeFormatLength]: 9296
THUMBNAIL[YCbCrPositioning]: 2
ExposureTime: 1/90
FNumber: 48/10
ExposureProgram: 2
ISOSpeedRatings: 100
ExifVersion: 0210
DateTimeOriginal: 2004:01:18 13:16:30
DateTimeDigitized: 2004:01:18 13:16:30
ComponentsConfiguration: 
ShutterSpeedValue: 65/10
ApertureValue: 46/10
ExposureBiasValue: 0/10
MaxApertureValue: 31/10
MeteringMode: 5
LightSource: 0
Flash: 1
MakerNote: 
FlashPixVersion: 0100
ColorSpace: 1
ExifImageWidth: 2400
ExifImageLength: 1600
InteroperabilityOffset: 704
FileSource: 
InterOperabilityIndex: R98
InterOperabilityVersion: 0100

Fetching an embedded thumbnail

<?php
header("Content-Type: image/jpeg");
echo exif_thumbnail(dirname(__FILE__) . '/image.jpg'); 
?>

Loading ...

Related Results :

  1. EXIF Headers from a JPEG
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author