9 Replies Latest reply: Jun 5, 2012 4:22 PM by johnrellis RSS

    LR 4 changes to photo:get*Metadata()

    johnrellis MVP

      Since we have no idea when the LR 4 SDK documentation might arrive, I started reverse-engineering changes to photo:getFormattedMetadata() and photo:getRawMetadata().  Here are the differences I've observed between LR 3.6 and LR 4.1 RC2:

       

      photo:getFormattedMetadata()

       

      gpsAltitude is now in feet rather than meters:

       

      "2500.0 ft" rather than "762.00 m"

       

      I don't know if this is localized to each country.

       

      photo:getRawMetadata()

       

      The representation of photos not in a stack has changed.  In LR 3.6 it is:

       

      countStackInFolderMembers = 1,

      stackInFolderMembers = {--table: 3

                  [1] = LrPhoto( id "14000" )},

      stackPositionInFolder = 1,

      topOfStackInFolderContainingPhoto = LrPhoto( id "14000" ),

       

      In LR 4.1 RC2 it is:

       

      countStackInFolderMembers = 0,

      stackInFolderMembers = {},

      stackPositionInFolder = 1,

       

      LR 4's representation is inconsistent but more memory-efficient.

       

      At last, there's pickStatus!

       

      0 = unflagged

      1 = flagged

      -1 = rejected

       

      I haven't tested whether pickStatus can be changed via photo:setRawMetadata().

       

      There's a new field root_uiid:

       

      root_uuid = "545E7456-C7D3-40F1-8E65-6F4225D057A4",

       

      photo:getDevelopSettings()

       

      ProcessVersion has these values:

       

      "5.0" = PV 2003

      "5.7" = PV 2010

      "6.7" = PV 2012

       

      These fields represent the new settings of PV 2012:

       

      AutoLateralCA = 0,

      Blacks2012 = 0,

      Clarity2012 = 0,

      Contrast2012 = 0,

      DefringeGreenAmount = 0,

      DefringeGreenHueHi = 60,

      DefringeGreenHueLo = 40,

      DefringePurpleAmount = 0}

      DefringePurpleHueHi = 70,

      DefringePurpleHudeLo = 30,

      Exposure2012 = 0,

      Highlights2012 = 0,

      Shadows2012 = 0,

      ToneCurveName2012 = "Linear",

      ToneCurvePV2012 = {--table: 6
      ToneCurvePV2012Blue = {--table: 5
      ToneCurvePV2012Green = {--table: 3

      ToneCurvePV2012Red = {--table: 2

        • 1. Re: LR 4 changes to photo:get*Metadata()
          areohbee Community Member

          Thanks John!

           

          Also, ProcessVersion = "6.6" may be returned for PV2012/beta-not-yet-converted to "6.7".

           

          R

          • 2. Re: LR 4 changes to photo:get*Metadata()
            jarnoh Community Member

            Btw, how does a photo actually get updated from 6.6 to 6.7?  I'm puzzled if I would need to handle 6.6 in my code at all (I'm not currently doing it, I know my UI doesnt work properly with 6.6 version)

            • 3. Re: LR 4 changes to photo:get*Metadata()
              johnrellis MVP

              Here's an updated list that includes video fields and Whites2012:

               

              photo:getFormattedMetadata()

               

              gpsAltitude is now in feet rather than meters:

               

              "2500.0 ft" rather than "762.00 m"

               

              I don't know if this is localized to each country.

               

              Video fields:

               

              duration = "01:04.0",

              frameRate = "30.000 fps",

               

              photo:getRawMetadata()

               

              The representation of photos not in a stack has changed. In LR 3.6 it is:

               

              countStackInFolderMembers = 1,

              stackInFolderMembers = {--table: 3

              [1] = LrPhoto( id "14000" )},

              stackPositionInFolder = 1,

              topOfStackInFolderContainingPhoto = LrPhoto( id "14000" ),

               

              In LR 4.1 RC2 it is:

               

              countStackInFolderMembers = 0,

              stackInFolderMembers = {},

              stackPositionInFolder = 1,

               

              LR 4's representation is inconsistent but more memory-efficient.

               

              At last, there's pickStatus!

               

              0 = unflagged

              1 = flagged

              -1 = rejected

               

              I haven't tested whether pickStatus can be changed via photo:setRawMetadata().

               

              There's a new field root_uiid:

               

              root_uuid = "545E7456-C7D3-40F1-8E65-6F4225D057A4",

               

              Video fields:

               

              album = "This is Album",

              altTapeName = "This is alternate tape name",

              audioSampleRate = "44100",

              cameraAngle = "Birds Eye Shot",

              cameraModel = "This is camera model",

              cameraMove = "Truck Left",

              client = "This is client",

              comment = "This is comment",

              composer = "This is composer",

              description = "Hello world"}}

              dimensions = {--table: 5

              director = "This is director",

              directorPhotography = "This is directory of photography",

              dm_artist = "This is  artist",

              dm_scene = "This is  scene",

              durationInSeconds = 64.066666666667,

              durationRatio = {--table: 6

                  numerator = 961,

                  denominator = 15},

              engineer = "This is engineer",

              genre = "This is Genre",

              good = "True",

              instrument = "This is instrument",

              logComment = "This is log comment",

              projectName = "This is project name",

              releaseDate = "This is release date",

              shotDate = "This is shot date",

              shotDay = "This is day of shoot",

              shotLocation = "This is shot location",

              shotName = "This is shot name",

              speakerPlacement = "This is speaker placement",

              tapeName = "This is tape name",

              trimmedDurationInSeconds = 64.066666666667,

              trimmedDurationRatio = {--table: 4

                  numerator = 961,

                  denominator = 15},

              videoPixelAspectRatio = 1,

               

              photo:getDevelopSettings()

               

              ProcessVersion has these values:

               

              "5.0" = PV 2003

              "5.7" = PV 2010

              "6.6" = PV 2012 beta

              "6.7" = PV 2012

               

              These fields represent the new settings of PV 2012:

               

              AutoLateralCA = 0,

              Blacks2012 = 0,

              Clarity2012 = 0,

              Contrast2012 = 0,

              DefringeGreenAmount = 0,

              DefringeGreenHueHi = 60,

              DefringeGreenHueLo = 40,

              DefringePurpleAmount = 0}

              DefringePurpleHueHi = 70,

              DefringePurpleHudeLo = 30,

              Exposure2012 = 0,

              Highlights2012 = 0,

              Shadows2012 = 0,

              ToneCurveName2012 = "Linear",

              ToneCurvePV2012 = {--table: 6

              ToneCurvePV2012Blue = {--table: 5

              ToneCurvePV2012Green = {--table: 3

              ToneCurvePV2012Red = {--table: 2

              Whites2012 = 0,

               

              Video fields:

               

              TrimEnd = {--table: 7
                  denominator = 15,
                  numerator = 961},
              TrimStart = {--table: 6
                  denominator = 1,
                  numerator = 0},

              • 4. Re: LR 4 changes to photo:get*Metadata()
                areohbee Community Member

                jarnoh wrote:

                 

                Btw, how does a photo actually get updated from 6.6 to 6.7?

                Automagically, and leisurely.

                 

                @Lr4.0, Lightroom would not convert all entries from 6.6 to 6.7 - only when one goes to view or make an adjustment. I'm really not sure what-all prompts it, I just noticed they've been sorta disappearing over time...

                 

                So, YES - any robust code must be able to recognize 6.6. I've gotten away with assuming it's identical to 6.7, but obviously there could be some differences or there wouldn't have been a different number in the first place.

                 

                I mean, I discovered it via error messages in my code that was originally not recognizing it.

                 

                I wish Adobe would have just converted all entries when reading a beta catalog, so there would not be this issue, but alas, that is not the case.

                 

                R

                • 5. Re: LR 4 changes to photo:get*Metadata()
                  areohbee Community Member

                  I'm assuming Adobe wanted to get the new defringing parameters in there before releasing the new SDK...

                   

                  Thx John,

                  R

                  • 6. Re: LR 4 changes to photo:get*Metadata()
                    jarnoh Community Member

                    Just tested:

                     

                    photo:setRawMetadata("pickStatus", -1) -- reject

                    photo:setRawMetadata("pickStatus", 0) -- no flag

                    photo:setRawMetadata("pickStatus", 1) -- pick

                     

                    These seem to be working as expected with 4.1 RC2.  Maybe we get API cropping for Lightroom 5.0?

                    • 7. Re: LR 4 changes to photo:get*Metadata()
                      johnrellis MVP

                      Maybe we get API cropping for Lightroom 5.0?

                      Almost all the mechanism is already present: photo:getDevelopSettings() returns the a photo's current crop settings, and LrApplication.addDevelopPresetForPlugin() lets a plugin create new presets. The only problem is that develop presets don't allow crop settings.

                      • 8. Re: LR 4 changes to photo:get*Metadata()
                        jarnoh Community Member

                        yep I know - its like saying that LR3 almost supported pick status?

                         

                        BTW LR4 does have some weird behaviour if you try to set CropWidth/CropHeight, the picture is then shown in wrong aspect ratio.  I had to filter out those from my XMP preset ripper plugin.

                        • 9. Re: LR 4 changes to photo:get*Metadata()
                          johnrellis MVP

                          The photo:getRawMetadata() field "description" listed above for video files is a bug -- it shouldn't be present.  See:

                           

                          http://feedback.photoshop.com/photoshop_family/topics/sdk_photo_getrawmetadata_reports_inc orrect_field_when_thm_sidecar_present