Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXIF Data LensModel property

Tags:

jquery

exif

I'm using below jQuery plugin to retrieve EXIF data from images

https://github.com/sanisoft/jQuery-fileExif/blob/master/jquery.exif.js

However there is no code in this to retrieve lens model data.

So I added the code

0xA434 : "LensModel",

after line 315 (0xA40C : "SubjectDistanceRange", )

But even if I try to retrieve it is coming back blank.

exifObject.LensModel

You can see a example here

https://jsfiddle.net/Lx4wdkhw/

You can use below image that have lens meta tag

https://www.flickr.com/photos/138863932@N02/29888704290/

Can someone point me out what I'm doing wrong here. Appreciate your help.

like image 720
Jordyn Avatar asked Oct 08 '16 07:10

Jordyn


1 Answers

Updated Answer

As I guessed in my original answer below, the LensModel is not in the section you expect, it is in the TIFF section. You need to put the tag you are looking for in EXIF.TiffTags[]:

  EXIF.TiffTags = {
  0x0100: "ImageWidth",
  0x0101: "ImageHeight",
  0xA434: "LensModel",               <--- ### HERE ###
  0x8769: "ExifIFDPointer",
  0x8825: "GPSInfoIFDPointer",

Original Answer

Not a complete answer, but may help you, or someone else work it out... if you run jhead on your image, the LensModel tag doesn't appear to be in the EXIF section, which has 32 entries starting with:

    Exif Dir:(dir has 32 entries)
        ExposureTime = 1/4000

and ending with:

        Unknown Tag ea1c Value = "?Í?"
        Unknown Tag ea1d Value = 2010

It seems to be in a subsequent section.

Here it is in full:

JFIF SOI marker: Units: 1 (dots per inch)  X-density=72 Y-density=72
Exif header 12234 bytes long
Exif section in Motorola order
(dir has 21 entries)
    Make = "Canon"
    Model = "Canon EOS REBEL T5"
    Orientation = 1
    DateTime = "2014:01:31 03:22:41"
    Artist = ""
    YCbCrPositioning = 2
    Unknown Tag 4746 Value = 0
    Unknown Tag 4749 Value = 0
    Copyright = ""
    ExifOffset = 2372
    Exif Dir:(dir has 32 entries)
        ExposureTime = 1/4000
        FNumber = 35/10
        ExposureProgram = 3
        ISOSpeedRatings = 100
        ExifVersion = "0230"
        DateTimeOriginal = "2014:01:31 03:22:41"
        DateTimeDigitized = "2014:01:31 03:22:41"
        ComponentsConfiguration = "?"
        ShutterSpeedValue = 786432/65536
        ApertureValue = 237568/65536
        ExposureBiasValue = 0/1
        MeteringMode = 5
        Flash = 16
        FocalLength = 18/1
        Maker note: (dir has 37 entries)
            Canon maker tag 0001 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 0002 Value = 0, 0, 0, 0
            Canon maker tag 0003 Value = 0, 0, 0, 0
            Canon maker tag 0004 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 0006 Value = ""
            Canon maker tag 0007 Value = ""
            Canon maker tag 0009 Value = ""
            Canon maker tag 000d Value = "CanonCanon EOS REBEL T52014:01:31 03:22:41 Çö÷Çùfià"à'dê0230êÊê˙ëíííííí&í|.íÜ.>íê00Líë00íí00†0100††@†Ä¢/F¢/N¢§^§^§§Í Í⁄Í"
            Canon maker tag 0010 Value = -2147482841
            Canon maker tag 0013 Value = 0, 0, 0, 0
            Canon maker tag 0019 Value = 1
            Canon maker tag 0026 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 0035 Value = 0, 0, 0, 0
            Canon maker tag 0093 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 0095 Value = ""
            Canon maker tag 0096 Value = ""
            Canon maker tag 0097 Value = ""
            Canon maker tag 0098 Value = 0, 0, 0, 0
            Canon maker tag 0099 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 009a Value = 0, 0, 0, 0, 0
            Canon maker tag 00a0 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            Canon maker tag 00aa Value = 0, 0, 0, 0, 0, 0
            Canon maker tag 00b4 Value = 1
            Canon maker tag 00d0 Value = 0
            Canon maker tag 00e0 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 4001 Value = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
            Canon maker tag 4008 Value = 0, 0, 0
            Canon maker tag 4009 Value = 0, 0, 0
            Canon maker tag 4010 Value = "ˇˇˇˇó∂q"
            Canon maker tag 4011 Value = "ˇˇEF-S18-55mm f/3.5-5.6 IS IIME0422512"
            Canon maker tag 4012 Value = ""
            Canon maker tag 4015 Value = ""
            Canon maker tag 4016 Value = 0, 0, 0, 0, 0, 0
            Canon maker tag 4017 Value = 0, 0
            Canon maker tag 4018 Value = 0, 0, 0
            Canon maker tag 4019 Value = ""
            Canon maker tag 4020 Value = 0, 0, 0, 0, 0
        UserComment = "?"
        SubSecTime = "00"
        SubSecTimeOriginal = "00"
        SubSecTimeDigitized = "00"
        FlashPixVersion = "0100"
        ColorSpace = 1
        ExifImageWidth = 5184
        ExifImageLength = 3456
        FocalPlaneXResolution = 5184000/905
        FocalPlaneYResolution = 3456000/595
        FocalPlaneResolutionUnit = 2
        CustomRendered = 0
        ExposureMode = 0
        WhiteBalance = 0
        SceneCaptureType = 0
        Unknown Tag ea1c Value = "?Í?"
        Unknown Tag ea1d Value = 2010
    GPS Dir offset = 12120
    GPS info dir:(dir has 1 entries)
        GPSVersionID        =""
    Unknown Tag 8830 Value = 2
    Unknown Tag 8832 Value = 100
    Windows-XP author = 
    Unknown Tag a430 Value = ""
    Unknown Tag a431 Value = "282074049031"
    Unknown Tag a432 Value = 18/1, 55/1, 0/0, 0/0
    Unknown Tag a434 Value = "EF-S18-55mm f/3.5-5.6 IS II"   <--- HERE IT IS
    Unknown Tag a435 Value = "00003bd8e5"
    Unknown Tag ea1c Value = "?Í?"
    Unknown Tag ea1d Value = 4118
Image cotains XMP section, 3193 bytes long
?yhttp://ns.adobe.com/xap/1.0/?<?xpacket begin='???' id='W5M0MpCehiHzreSzNTczkc9d'?>?
<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
><rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:xmp="http://ns.adobe.c
om/xap/1.0/"><xmp:Rating>0</xmp:Rating><xmp:CreateDate>2014-01-31T03:22:41</xmp:CreateDate></rdf:Des
cription><rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:MicrosoftPhoto
="http://ns.microsoft.com/photo/1.0/"><MicrosoftPhoto:Rating>0</MicrosoftPhoto:Rating></rdf:Descript
ion><rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:dc="http://purl.org
/dc/elements/1.1/"/><rdf:Description rdf:about="uuid:faf5bdd5-ba3d-11da-ad31-d33d75182f1b" xmlns:dc=
"http://purl.org/dc/elements/1.1/"><dc:rights><rdf:Alt xmlns:rdf="http://www.w3.org/1999/02/22-rdf-s
yntax-ns#"><rdf:li xml:lang="x-default"></rdf:li></rdf:Alt>?
???</dc:rights><dc:creator><rdf:Seq xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:li>
</rdf:li></rdf:Seq>?
???</dc:creator></rdf:Description></rdf:RDF></x:xmpmeta>?

Approximate quality factor for qtable 0: 98 (scale 4.64, var 2.36)
Approximate quality factor for qtable 1: 98 (scale 4.14, var 0.14)
JPEG image is 3888w * 2474h, 3 color components, 8 bits per sample
File name    : 29888704290_78aae5380b_o.jpg
File size    : 3584942 bytes
File date    : 2016:10:08 07:12:04
Camera make  : Canon
Camera model : Canon EOS REBEL T5
Date/Time    : 2014:01:31 03:22:41
Resolution   : 3888 x 2474
Flash used   : No
Focal length : 18.0mm  (35mm equivalent: 28mm)
CCD width    : 22.99mm
Exposure time: 0.0003 s  (1/4000)
Aperture     : f/3.5
ISO equiv.   : 100
Whitebalance : Auto
Metering Mode: pattern
Exposure     : aperture priority (semi-auto)
GPS Latitude : ? ?
GPS Longitude: ? ?
like image 179
Mark Setchell Avatar answered Oct 02 '22 20:10

Mark Setchell