Project

General

Profile

Actions

Lens Recognition in Exiv2 v0.26 (and later)

I've given up on lens recognition. Manufacturers use the same lensID for more than one lens. This is discussed here: http://dev.exiv2.org/issues/1212

On the trunk and v0.26, you can add your lens to the file ~/.exiv2. You need to know your lensID

636 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -pv --grep lens/i ~/Stonehenge.jpg 
0x0083 Nikon3       LensType                    Byte        1  14    
0x0084 Nikon3       Lens                        Rational    4  180/10 2500/10 35/10 63/10
0x008b Nikon3       LensFStops                  Undefined   4  55 1 12 0
0x000c NikonLd3     LensIDNumber                Byte        1  146 <--- This number
0x000d NikonLd3     LensFStops                  Byte        1  55
637 rmills@rmillsmbp:~/gnu/exiv2/trunk $ 
Put it into ~/.exiv2 (or c:\Users\username\exiv2.ini on MSVC/MinGW builds).
637 rmills@rmillsmbp:~/gnu/exiv2/trunk $ cat ~/.exiv2 
[nikon]
146=Robin's Sigma Lens  <--- The name of your lens

638 rmills@rmillsmbp:~/gnu/exiv2/trunk $ 
Now your lens will be recognised.
638 rmills@rmillsmbp:~/gnu/exiv2/trunk $ exiv2 -pa --grep lens/i ~/Stonehenge.jpg 
Exif.Nikon3.LensType                         Byte        1  D G VR
Exif.Nikon3.Lens                             Rational    4  18-250mm F3.5-6.3
Exif.Nikon3.LensFStops                       Undefined   4  4.58333
Exif.NikonLd3.LensIDNumber                   Byte        1  Robin's Sigma Lens  <--- Will be reported
Exif.NikonLd3.LensFStops                     Byte        1  F4.6
638 rmills@rmillsmbp:~/gnu/exiv2/trunk $ 

Location of the Config File

Windows:

C:\WINDOWS\system32>exiv2 -vVg config
exiv2 0.25 001900 (32 bit build)
config_path=C:\Users\rmills\exiv2.ini

Cygwin:

501 rmills@rmillsmbp-w7:~ $ exiv2 -vVg config
exiv2 0.26 001a00 (64 bit build)
config_path=/home/rmills/.exiv2
502 rmills@rmillsmbp-w7:~ $ cygpath -aw /home/rmills/.exiv2
C:\cygwin64\home\rmills\.exiv2
503 rmills@rmillsmbp-w7:~ $

MinGW:

412 -32- /c/temp/dist/mingw/bin> ./exiv2 -vVg config
exiv2 0.26 001a00 (32 bit build)
config_path=C:\Users\rmills\exiv2.ini
413 -32- /c/temp/dist/mingw/bin>

MacOS-X:

530 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2 $ exiv2 -vV --grep config
exiv2 0.26 001a00 (64 bit build)
library=/usr/lib/system/libsystem_configuration.dylib
config_path=/Users/rmills/.exiv2
531 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2 $ 

Linux:

2019 rmills@ubuntu:~/gnu/github/exiv2/exiv2/build $ bin/exiv2 -vVg config
exiv2 0.26 001a00 (64 bit build)
config_path=/home/rmills/.exiv2
2020 rmills@ubuntu:~/gnu/github/exiv2/exiv2/build $ 

Updated by Robin Mills over 3 years ago · 9 revisions