I've recently come across the php function exif_read_data
- which is pretty awesome. I'm using it on my photography site, and while it works pretty well, I'm struggling to work out why ApertureFNumber
isn't working. The code I'm using is:
$exif_data = exif_read_data($image[0]);
echo $exif_data['Model'];
echo $exif_data['ExposureTime'];
echo $exif_data['FNumber'];
echo $exif_data['ApertureFNumber'];
echo $exif_data['ISOSpeedRatings'];
echo $exif_data['DateTime'];
(styling removed)
I used FNumber
as well as ApertureFNumber
for testing because FNumber
works, while ApertureFNumber
just returns blank. All the other fields work fine.
I did a var_dump of $exif_data - and this is what I get (the abridged version):
["ApertureFNumber"]=> string(5) "f/3.5"
["FNumber"]=> string(5) "35/10"
What have I missed that FNumber
works, but ApertureFNumber
doesn't?
--
EDIT - Complete var_dump added as requested
array(52) { ["FileName"]=> string(18) "MYD-67-900x602.jpg" ["FileDateTime"]=> int(0) ["FileSize"]=> int(123278) ["FileType"]=> int(2) ["MimeType"]=> string(10) "image/jpeg" ["SectionsFound"]=> string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF" ["COMPUTED"]=> array(9) { ["html"]=> string(24) "width="900" height="602"" ["Height"]=> int(602) ["Width"]=> int(900) ["IsColor"]=> int(1) ["ByteOrderMotorola"]=> int(0) ["ApertureFNumber"]=> string(5) "f/3.5" ["FocusDistance"]=> string(14) "4294967296.00m" ["Thumbnail.FileType"]=> int(2) ["Thumbnail.MimeType"]=> string(10) "image/jpeg" } ["Make"]=> string(17) "NIKON CORPORATION" ["Model"]=> string(9) "NIKON D60" ["XResolution"]=> string(5) "200/1" ["YResolution"]=> string(5) "200/1" ["ResolutionUnit"]=> int(2) ["Software"]=> string(41) "Adobe Photoshop Lightroom 4.4 (Macintosh)" ["DateTime"]=> string(19) "2013:07:06 10:07:40" ["Exif_IFD_Pointer"]=> int(216) ["THUMBNAIL"]=> array(6) { ["Compression"]=> int(6) ["XResolution"]=> string(5) "200/1" ["YResolution"]=> string(5) "200/1" ["ResolutionUnit"]=> int(2) ["JPEGInterchangeFormat"]=> int(932) ["JPEGInterchangeFormatLength"]=> int(8995) } ["ExposureTime"]=> string(5) "1/800" ["FNumber"]=> string(5) "35/10" ["ExposureProgram"]=> int(1) ["ISOSpeedRatings"]=> int(100) ["ExifVersion"]=> string(4) "0230" ["DateTimeOriginal"]=> string(19) "2008:10:30 16:04:34" ["DateTimeDigitized"]=> string(19) "2008:10:30 16:04:34" ["ShutterSpeedValue"]=> string(15) "9643856/1000000" ["ApertureValue"]=> string(13) "361471/100000" ["ExposureBiasValue"]=> string(3) "0/6" ["MaxApertureValue"]=> string(5) "36/10" ["SubjectDistance"]=> string(4) "-1/1" ["MeteringMode"]=> int(5) ["LightSource"]=> int(0) ["Flash"]=> int(0) ["FocalLength"]=> string(4) "18/1" ["SubSecTimeOriginal"]=> string(2) "50" ["SubSecTimeDigitized"]=> string(2) "50" ["SensingMethod"]=> int(2) ["FileSource"]=> string(1) "" ["SceneType"]=> string(1) "" ["CFAPattern"]=> string(8) "" ["CustomRendered"]=> int(0) ["ExposureMode"]=> int(1) ["WhiteBalance"]=> int(0) ["DigitalZoomRatio"]=> string(3) "1/1" ["FocalLengthIn35mmFilm"]=> int(27) ["SceneCaptureType"]=> int(0) ["GainControl"]=> int(0) ["Contrast"]=> int(0) ["Saturation"]=> int(0) ["Sharpness"]=> int(0) ["SubjectDistanceRange"]=> int(0) ["UndefinedTag:0xA431"]=> string(7) "6265825" ["UndefinedTag:0xA432"]=> array(4) { [0]=> string(4) "18/1" [1]=> string(4) "55/1" [2]=> string(5) "35/10" [3]=> string(5) "56/10" } ["UndefinedTag:0xA434"]=> string(22) "18.0-55.0 mm f/3.5-5.6" }