Is it possible to change the LensID of a raw file? If yes, how?

Started by mrjayviper, August 29, 2020, 11:19:15 AM

Previous topic - Next topic

mrjayviper

I have a fully manual lens and I want to edit the LensID for the exif information.

as a test, I retrieved the lens info of one of my AF Sigma lens.

➜  exiftool my-file1-here.NEF | grep -i lens
Lens Type                       : G VR
Lens                            : 24-105mm f/4
Lens Data Version               : 0204
Lens ID Number                  : 138
Lens F Stops                    : 5.00
Lens ID                         : Sigma 24-105mm F4 DG OS HSM
Lens Spec                       : 24-105mm f/4 G VR


I tried

exiftool -LensID="my-lens-id-here" my-file2-here.nef"

and I got this error: Warning: Expected one or more integer values in XMP-aux:LensID (ValueConvInv)

Thanks for the help!

StarGeek

Depends upon which LensID is displayed in your output.

Run this command instead (no need to grep)
exiftool -g1 -a -s -*lens* my-file1-here.NEF
If LensID is only showing up in the Composite group, then no. Composite tags aren't embedded data, they're derived from multiple other tags. You would have to change those underlying tags to show a different value.

If it's not part of the Composite group, it may be possible, but it may a tag that has a limited set of values that can be used. For example, that error response is because the only LensID tag that seems to be available for writing in that file is the XMP-aux:LensID, which is from an outdated tag group (XMP-aux) and only accepts integer values.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

mrjayviper


exiftool -g1 -a -s -*lens*   "my-file1-here.NEF"
bash: no matches found: -*lens*


not possible then?

Thanks again!

EDIT: Not sure if this matters but I'm on macOS and installed exiftool via homebrew.

StarGeek

Ah, an asterisk is a special character in bash.  I think you need to put quotes around it. Try
exiftool -g1 -a -s '-*lens*' 'my-file1-here.NEF'

Also, do to a formatting oddity of this forum, my original post had a no-break space in it, so copy/pasting it might have introduced an error there.  Fixing.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

mrjayviper

Thanks for the help.


➜  exiftool -g1 -a -s '-*lens*'   "my-file1-here.NEF"
---- XMP-aux ----
Lens                            : Takumar 55mm f2
---- Nikon ----
LensType                        : AF
Lens                            : 55mm f/2
LensFStops                      : 0.00
LensDataVersion                 : 0204
LensIDNumber                    : 0
LensFStops                      : 0.00
---- ExifIFD ----
LensModel                       : Takumar 55mm f2
---- Composite ----
LensID                          : Unknown (00 00 00 00 00 00 00 00)
LensSpec                        : 55mm f/2 AF


seems not possible then?

StarGeek

Does your lens appear on this list (long list, small text).  If so, you could try and set it like this, using that first entry as an example
exiftool -Nikon:LensIDNumber="Manual Lens No CPU" file.nef

Or maybe I'm misunderstanding.  Are you trying to set a lens name or some other form of ID for it?
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype