14 Replies Latest reply on Sep 19, 2012 1:21 PM by mycroft.holmes

    LR4 Lens data problem




      I'm a Sony user and installed the Lightroom 4 trial.  It imported the old 3.6 catalog and gave me a nice new Lightroom 4 catalog.  So far so good.  Everything looked normal.


      Now, when I import new .ARW (Sony Raw) pics into LR4, I'm not getting the lens information correctly.  I use a tool call 'alphalensinfo' that reads .ARW files and creates .XMP files with the correct lens name.  LR3.6 used to import the pics and read the XMP, giving a correct lens name in the LR catalog.  LR4 seems to fail at this. 


      For instance, with my Samyang 8mm, Alphalensinfo would add the exif field to the XMP file saying "Samyang 8mm".  LR3.6 then shows "Samyang 8mm" for the lens, after import.  LR4 shows "---" for the lens.


      Has something changed in the way LR 4 handles Lens EXIF information?



        • 1. Re: LR4 Lens data problem
          DdeGannes Adobe Community Professional

          Maybe alphalensinfo needs an update for LR 4. Check their web site.

          • 2. Re: LR4 Lens data problem

            I use ExifToolGui for one of my Tamron lenses and it worked under Lighroom 4 (it also worked under 3.x).

            • 3. Re: LR4 Lens data problem

              This has been reported several times:





              I also wrote it here:





              I also repeated the test using the very latest version of exiftool (the revision history says they fixed a couple of bugs in handling the lens tags for sony images).

              From some empirical evidence, it looks like if the lens was correctly identified by LR4, then you can rename it with exiftool.

              However the samyang lens, which is tagged as "----" in LR4, cannot be fixed and no matter what you do, it always displays as "----" (and if you resave the xmp, it overwrites your valid lensid string with ----).

              As an example, I have a tamron lens which was previously called "60 F2.0" and now is just "60 F2", and I was able to fix it.

              I have seen that the xmp file for samyang images is slightly different, but I have not yet a solution.

              • 4. Re: LR4 Lens data problem
                mikey_2000 Level 1

                Well, I tried again.  In a similar way to Mycroft did above.   I used alphalensinfo to make a .xmp file for my lens (I tried various results with identical results).   I import the pic into LR4 and the lens name appearing in Lightroom is *NOT* what I had put into the XMP - it is some kind of Adobe default lens name. If I then 'save metadata to files' from light room, I can see LR4 has amended the XMP.  If I use notepad to edit the aux:Lens field again to reflect what I want it to really say, save the xmp file then use LR4 to "read metadata from files", it ignores my new aux:Lens information.  A re-save of the metadata updates the XMP file again back to that LR4 default lens name.


                This is most annoying.


                If I follow the exact same steps, in LR3.6, it all works properly and my aux:Lens fields in the XMP files are read correctly by lightroom.

                • 5. Re: LR4 Lens data problem
                  mycroft.holmes Level 1

                  Ok, I may have a workaround, but I'm not familiar enough with sqlite to give you a working solution yet: I give you the idea just in case there's a sqlite expert listening...

                  According to this page, the EXIF lens name is AgInternedExifLens.value




                  So I guess it may be possible to issue a command from terminal like

                  sqlite -csv LR.lrcat "select * from AgInternedExifLens where AgInternedExifLens.value = '----'"


                  then rewrite the string and re-import with an "update" command, possibly something like


                  "update AgInternedExifLens set AgInternedExifLens.value = '500mm F4' where AgInternedExifLens.value = '----'"


                  However I'll have a look at the schema and let you know.

                  • 6. Re: LR4 Lens data problem
                    dorin_nicolaescu Level 5

                    This field holds a sort of lens name cache for quick acces. It is used in the Library Filter. The actual value that is displayed in the Metadata panel is taken from Adobe_AdditionalMetadata.xmp.


                    Also, the AgInternedExifLens.value will be updated (ovewritten) the next time you do a Read Metadata.


                    So, if all you need is correct display in Library filter and you're not going to re-read the metadata, that is an easy fix.

                    • 7. Re: LR4 Lens data problem
                      mycroft.holmes Level 1

                      Is Adobe_AdditionalMetadata.xmp a piece of xml (i.e. the entire xmp) stored in the db?

                      In this case I should probably rewrite both.

                      • 9. Re: LR4 Lens data problem
                        mikey_2000 Level 1



                        I'm not a computer dunce (I used to be MCSE for Windows 2000 and CNE for Netware 5 if you remember that far back!)  However, you have totally lost me.


                        Is this a bug in LR4?  Is it just a change in the way LR4 works?


                        Either way, I'd love to know a simple way to get my old lens identifications working in LR4, just like they used to in LR3.x.


                        I'm no longer a computer tech wizard, I'm just a guy with a camera and I've not had to place a support call with Adobe before.  Do they view these forums or is there a formal way to report a bug?



                        • 10. Re: LR4 Lens data problem
                          ssprengel Adobe Community Professional & MVP

                          You might add your 2-cents to the feedback thread linked near the beginning of this thread, along with doing a +1 to indicate you have the same problem.  The feedback site is where to report issues, and the camera-raw engineer Eric Chan has already commented on that thread.


                          Like you, I am both a computer guy and a camera guy, and cannot quite determine from what people have said, none being official Adobe people, whether there is a way to use some plug-in or SQLite command to fix things or not.  LR4 is obviously doing something different than LR3 but since the fix for previous versions of LR seems like a hack, then LR4 doing something different wouldn’t be a bug, but having a new hack would be useful.  I would guess that a plug-in might need to be written to do this specific function if that Adobe_AdditionalMetadata.xmp data area needs to be modified.

                          • 11. Re: LR4 Lens data problem
                            mycroft.holmes Level 1

                            Ok, the sqlite query works fine, it just requires some manual work: here are the Mac commands.

                            close lightroom, open terminal and enter:


                            sqlite3 -csv Lightroom\ 4\ Catalog.lrcat "select AgInternedExifLens.value, AgHarvestedExifMetadata.lensRef, count(*) c from AgHarvestedExifMetadata, AgInternedExifLens where AgInternedExifLens.id_local = AgHarvestedExifMetadata.lensRef group by AgHarvestedExifMetadata.lensRef order by c desc;"


                            you will see some stats in the form





                            "8mm F3.5 Fisheye",871646,89





                            the following command rewrites the lens identifier, so all photos linked to ---- are now linked to "8mm F3.5":


                            "update AgHarvestedExifMetadata set lensRef = 871646 where lensRef = 524399;"




                            you can also add a condition: e.g. limit to some particular day


                            "update AgHarvestedExifMetadata set lensRef=871646 where dateMonth=12 and dateYear=2011 and dateDay=26 and lensRef=524399;"

                            • 12. Re: LR4 Lens data problem
                              mikey_2000 Level 1



                              Or perhaps it's just a little bug and might get fixed in 4.1.   I emailed one of the developers an offending xmp file.  Hopefully everything can go back to normal again soon...



                              • 13. Re: LR4 Lens data problem
                                mikey_2000 Level 1

                                Just an update - this appears to be fixed in LR4.2 RC1


                                Thanks adobe!

                                • 14. Re: LR4 Lens data problem
                                  mycroft.holmes Level 1

                                  I would strongly suggest Adobe to make the lens field editable, like caption.

                                  This is probably a trivial change on their side, and it would get rid of all this sort of problems, and it would solve many more.


                                  Just a trivial example: when I put a filter on the lens, of course it won't show up in EXIF data , so I usually add a keyword.

                                  It would be nicer to select all the photos and modify the lens name directly in LR to (say) "85mm + Closeup".