Page 1 of 1

exif_read_data: data not showing up

Posted: Sat Feb 25, 2006 8:14 pm
by Nathaniel
For debugging purposes, I have been using this sample code from the php manual:

Code: Select all

echo $_FILES['photo']['tmp_name'] . ":<br />\n";
	$exif = exif_read_data($_FILES['photo']['tmp_name'], 'IFD0');
	echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
	
	$exif = exif_read_data($_FILES['photo']['tmp_name'], 0, true);
	echo $_FILES['photo']['tmp_name'] . ":<br />\n";
	foreach ($exif as $key => $section) {
	   foreach ($section as $name => $val) {
	       echo "$key.$name: $val<br />\n";
	   }
}
This spits out, for my sample image:
Sample Results wrote:/tmp/phpD5DucV:
Image contains headers
/tmp/phpD5DucV:
FILE.FileName: phpD5DucV
FILE.FileDateTime: 1140919298
FILE.FileSize: 67009
FILE.FileType: 2
FILE.MimeType: image/jpeg
FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP
COMPUTED.html: width="900" height="360"
COMPUTED.Height: 360
COMPUTED.Width: 900
COMPUTED.IsColor: 1
COMPUTED.ByteOrderMotorola: 0
COMPUTED.CCDWidth: 7mm
COMPUTED.ApertureFNumber: f/13.0
COMPUTED.UserComment:
COMPUTED.UserCommentEncoding: UNDEFINED
COMPUTED.Copyright: Copyright Above Productions and Above Photography. This image is avliable for purchase but is not available for resale.
COMPUTED.Thumbnail.FileType: 2
COMPUTED.Thumbnail.MimeType: image/jpeg
IFD0.ImageDescription: This is the description
IFD0.Make: Canon
IFD0.Model: Canon EOS 20D
IFD0.Orientation: 1
IFD0.XResolution: 3000000/10000
IFD0.YResolution: 3000000/10000
IFD0.ResolutionUnit: 2
IFD0.Software: Adobe Photoshop CS2 Windows
IFD0.DateTime: 2006:02:26 11:56:53
IFD0.Artist: Photographer: Mike Swaine
IFD0.YCbCrPositioning: 2
IFD0.Copyright: Copyright Above Productions and Above Photography. This image is avliable for purchase but is not available for resale.
IFD0.Exif_IFD_Pointer: 428
THUMBNAIL.Compression: 6
THUMBNAIL.XResolution: 72/1
THUMBNAIL.YResolution: 72/1
THUMBNAIL.ResolutionUnit: 2
THUMBNAIL.JPEGInterchangeFormat: 1254
THUMBNAIL.JPEGInterchangeFormatLength: 2427
EXIF.ExposureTime: 1/2000
EXIF.FNumber: 13/1
EXIF.ExposureProgram: 4
EXIF.ISOSpeedRatings: 1600
EXIF.ExifVersion: 0221
EXIF.DateTimeOriginal: 2005:09:03 10:37:39
EXIF.DateTimeDigitized: 2005:09:03 10:37:39
EXIF.ComponentsConfiguration:
Is there any way that that code might be skipping something? Some bug or feature in exif_read_data that I missed? Some section of EXIF not being grabbed by the function? It seems improbable to me, but there is supposed to be a title in that exif data, and it is not showing up. Could some data be getting stripped in the upload process?

- Nathaniel