Lightroom 4: EXIF Lens ID hand editing .xmp files

  • 7
  • Problem
  • Updated 4 years ago
  • Solved
  • (Edited)
I have always edited my .xmp files with lens id info because the defaults were not always accurate. This always worked with LR. Now I have upgraded to LR4 and the exif data does not seem to be read. I try reading exif info, but it does not change in LR, even though I can open a ,xmp file and see that the data has been changed and is now correct. LR does not recognize the new info.
Photo of robert stull

robert stull

  • 3 Posts
  • 0 Reply Likes
  • sad

Posted 7 years ago

  • 7
Photo of robert stull

robert stull

  • 3 Posts
  • 0 Reply Likes
Anyone??
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 627 Posts
  • 132 Reply Likes
What EXIF tag are you editing? There is a LensModel tag in EXIF 2.3 that Lr reads.
Photo of Mike Phillips

Mike Phillips

  • 7 Posts
  • 0 Reply Likes
Eric, I have the same sort of problem. I use a Sony A77 and have an extreme version of the problem. Most lenses get given a sort of 'Adobe' name which is sometimes close enough. However, i use a commandline tool called alphalensinfo to generate .xmp sidecars before I import the raw files into LR. This tool uses a personalised lens table and uses the Sony Lens ID and various other bits of lens data to uniquely identify a lens and write a personalised "proper" lens name.

I say my problem is "extreme" in that when I use my manual, unchipped Samyang 8mm lens, I generate the .xmp files then import the photos. LR4ignores the lens name and just gives it the lens name "----". In LR3.x, the same .xmp results in the lens name showing as "Samyang 8mm F3.5 Fisheye", as expected. It's just LR4 that is giving me problems.

In LR4, if I choose "Save metadata to files" and re-examine the xmp file, it has changed aux:Lens back to "----".

Here's a sample of the contents of one of the .xmp files generated by AlphaLensInfo.

Samyang 8mm F3.5 Fisheye
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 627 Posts
  • 132 Reply Likes
Official Response
Can you send me the XMP file, or post it? (madmanchan2000@yahoo.com)
Photo of Mike Phillips

Mike Phillips

  • 7 Posts
  • 0 Reply Likes
I've sent you one just a moment ago! Amusingly, I tried posting it in my post above but the forum app stripped it out, leaving only the words "Samyang 8mm F3.5 Fisheye

Cheers
Photo of robert stull

robert stull

  • 3 Posts
  • 0 Reply Likes
Interesting. Thank you both for responding. Interestingly, I am also using a Sony A77. However, I didn't have any trouble with earlier versions of LR. It was only after LR4 upgrade that I've had a problem.

Eric, I don't see a LensModel tag within xmp. I modify the lensID tag and always have. These are the only tags I see that mention "lens".

aux:LensInfo="160/10 500/10 28/10 28/10"
aux:Lens="DT 16-50mm F2.8 SSM"
aux:LensID="63"

I'll send you a full xmp file. Thank you for investigating.
Photo of mycroft holmes

mycroft holmes

  • 4 Posts
  • 0 Reply Likes
This issue is being discussed in several places: it's definitely a problem/undocumented change in LR4.
At the moment, I fixed it modifying the sqlite database -- not that I liked it.

http://forums.adobe.com/message/4300834
Photo of Mike Phillips

Mike Phillips

  • 7 Posts
  • 0 Reply Likes
Is there any update on this? LR4 is definitely doing something different to LR3.x.

There is quite a long thread on www.dyxum.com (Sony/Minolta user site) discussing this. Perhaps there is some useful info for the LR developers? Here's the URL.

link to Dyxum thread last page.
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 627 Posts
  • 132 Reply Likes
Unfortunately I have not yet had a chance to address this.
Photo of Allan Olesen

Allan Olesen

  • 64 Posts
  • 6 Reply Likes
Actually, the cause of the problem is well understood by some users. I hope it is well understood by Adobe too, but otherwise I will give a summary:

1. The lens description can exist in at least two different tags in a raw file:
Exif:LensModel and XMP:Lens

2. If both tags are present, LR 4 will give Exif:LensModel higher priority than XMP:Lens.

3. Exif:LensModel cannot be written to a sidecar xmp file.

1+2+3: If a camera creates an Exif:LensModel tag with wrong content, there is no way to override it and get the correct content into LR4 by writing the correct content into an xmp sidecar file. Then only option (besides manipulating the LR4 catalog) is deleting or modifying the Exif:LensModel in the raw file, and a lot of us certainly don't want to do that.

This is very annoying, since a lot of third party lenses for the Sony platform (I don't know about other platforms) need some kind of manual correction of the lens name because lens manufacturers reuse old Lens IDs.

The simple fix would of course be to give higher priority to XMP:Lens. And if that has some unwanted results, then at least make this priority:
1. XMP:Lens written in an xmp sidecar file.
2. Exif:LensModel written in the raw file.
3. XMP:Lens written in the raw file.
Photo of J. Roost

J. Roost

  • 1 Post
  • 0 Reply Likes
Another simple, partial fix:

Have Lightroom ignore Exif:LensModel (0xA434) if it only contains "----"
(and/or perform some other validation checks)

Then XMP-aux:Lens, in image file or sidecar file, would be next to be used.
Photo of Allan Olesen

Allan Olesen

  • 64 Posts
  • 6 Reply Likes
That would be a very partial fix. So partial that it would be unusable to me.

My lenses do not show up as "----" in Exif:LensModel, but I still need/want to change their description.
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 627 Posts
  • 132 Reply Likes
I will fix this, but unfortunately it will not make the cut for ACR 7.1 / LR 4.1.
Photo of Mike Phillips

Mike Phillips

  • 7 Posts
  • 0 Reply Likes
Eric,

This seems to be fixed in LR4.2 RC1. Thanks!
Photo of Eric Chan

Eric Chan, Camera Raw Engineer

  • 627 Posts
  • 132 Reply Likes
Great! Enjoy. :-)
Photo of JUliano VEnecui

JUliano VEnecui

  • 1 Post
  • 0 Reply Likes
Hello every body.
I'm looking for a solution about the omission of lens brands in Exif tags generated by Lightroom (even 4.2 version).

When I export with Aperture, correct Lens ID appears in the Exif data:
Eg Lens Model: Canon EF-S 18-55mm f/3.5-5.6 IS

But when I export the same CR2 file in Lightroom, I got this:
Lens Model: EF-S 18-55mm f/3.5-5.6 IS

In my case this is a "problem". I need Exif tags containing brands of lens for an accurate process with others softwares, for example with PTGUI to generate spherical panoramic.
Photo of mycroft holmes

mycroft holmes

  • 4 Posts
  • 0 Reply Likes
Lightroom never writes the brand name in the lens tag by design. It's quite easy to do it by hand with exiftool, but you need LR3.x or LR4.2 (due to a bug LR4.0 and 4.1 will simply ignore your changes).
exiftool does emit the brand name in lens tag by default, so the procedure looks roughly like this:

- ensure that all photos in your collection have a sidecar xmp; this is the default for me, because I import only RAW photos, adding copyright information. otherwise, just select all the photos and there's a command metatada -> save metadata to files (but verify that it works)
- open a prompt in the root of your photo collection
- enter a (long) exiftool commandline that will read the lens tag from the raw file and write it in the xmp file
- reopen LR, select all the photos and pick the command metadata -> load from files.

however, this may break the "auto" setting in LR lens correction.
if you need further information, let me know. I have the exact exiftool command somewhee (for mac)
Photo of Carmelo D'Agostino

Carmelo D'Agostino

  • 1 Post
  • 0 Reply Likes
could you please let me know the right command line to write in esiftool on my Mac?
Photo of mycroft holmes

mycroft holmes

  • 4 Posts
  • 0 Reply Likes
for "manual" fixes, e.g. a brute force find and replace, I use this:

exiftool -r -ext xmp -if '$Lens =~ /Sony AF 75-300mm/' -Lens="75-300mm F4.5-5.6" *

-r: process recursively all folders
-ext xmp: just process .xmp files
-if ...: if the field lens CONTAINS anywhere the string between /.../
-Lens: ...then replace it with what follows

The RE is case sensitive. The operator !~ is used for spotting a non-match.

Sometimes I want to do something different, e.g. occasionally exiftool itself is able to identify the lens, and lightroom is not. So I want to copy whatever exiftool's response in the xmp.
This, for example, will update all xmp files (in current folder) if Lens contains the string "----":

for i in *.xmp; do exiftool -if '$xmp:Lens =~ /----/' -xmp:Lens="$(exiftool -s3 -LensType "${i%.xmp}.ARW")" "${i}"; done

let me know if this helped.