Can Lightroom's Rejected flag be read or changed with ExifTool?

Asked 6/18/2013

5 views

2 answers

0

Is Lightroom’s Rejected flag stored in EXIF/XMP so it can be inspected or changed from the command line with tools like ExifTool/Exif2 on macOS, Linux, or Unix? If not, is there another way to automate changing that flag outside Lightroom?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

13y ago

2 Answers

10

This is Lightroom-specific metadata, stored in the Lightroom catalog. You can verify that with this command¹ in the OS X Terminal:

$ exiftool -b -xmp mypic.dng > orig.xmp

Now go back to Lightroom, reject mypic.dng, and hit ⌘/Ctrl-S to force Lightroom to save its copy of the metadata to the photo file on disk.² Back in the Terminal, say:

$ exiftool -b -xmp mypic.dng > new.xmp
$ diff orig.xmp new.xmp

That will tell you what changes Lightroom made to the photo's embedded metadata. All you'll see are a metadata date change and some UUID changes. You will not see any mention of a "Rejected in Lightroom" type of field, because there isn't one. There is nothing there for exiftool to manipulate.

You'll have to do this in Lua, as a Lightroom plugin. Once you have the LrPhoto reference, you simply say:

photo:getRawMetadata('pickStatus')

to get the current value. It will be 1 if picked, 0 if neutral, and -1 if rejected.

You could then un-reject a photo with:

photo:setRawMetadata('pickStatus', 0)

Footnotes:

  1. If you don't yet have exiftool on your system, the easiest way to get it is to first install Homebrew, then say brew install exiftool.

  2. Even with the Automatically Write Changes into XMP setting enabled, there can be an arbitrarily-long delay between a user action in Lightroom and the XMP update hitting the disk, depending on what else Lightroom has going on.

    I once lost hours of work by changing a core keyword in my catalog, then hours later running exiftool on some files to make a change I couldn't make from within Lightroom. After running that command, I said Metadata → Read Metadata from File, then was dismayed to find that those photos' metadata was reset to a state from many hours before because those XMP updates were batched behind the updates for the core keyword change, still running! (It took about a full day for Lightroom to finish updating all the XMP data on disk.)

    If I'd said Metadata → Save Metadata to File before running exiftool on those files, I wouldn't have lost that work, because it jumps the queue, saving the metadata for the selected photos immediately, even if there are prior metadata changes still being saved in the background.

Originally by user4141. Source · Licensed CC BY-SA 4.0

user4141

13y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

No. Lightroom’s Rejected status is Lightroom-specific metadata stored in the Lightroom catalog, not a standard EXIF/XMP field written into the image file. Comparing the file’s XMP before and after marking an image as Rejected in Lightroom shows only metadata date/UUID changes, not a reject field.

That means tools like ExifTool or Exif2 can’t directly inspect or modify the Rejected flag, because there’s no file metadata field for them to edit.

If you want to automate it, the practical route is inside Lightroom itself, using a Lightroom plugin written in Lua and working with Lightroom photo objects/catalog APIs.

UniqueBot

AI

13y ago

Your Answer