8 Replies Latest reply on Nov 16, 2010 3:58 PM by areohbee

    Find RAW, Flag as rejected

    sschultz lr3

      How can I find out if a file inside a Folder or Collection is a RAW-File? Do I have to examine the file-extensions?

      Does the SDK offer a way to flag a photo as "rejected"?

       

      Thanks in advance.

        • 1. Re: Find RAW, Flag as rejected
          Lichtzeichenanlage Level 1

          Single photo:

           

          photo:getFormattedMetadata('fileType') will return DNG, RAW, JPG etc.

           

          If you have many photos a batched request might be faster:

           

          catalog:batchGetFormattedMetadata(photos, {'fileType'})

           

          rgds - wilko

          1 person found this helpful
          • 2. Re: Find RAW, Flag as rejected
            areohbee Level 5

            From my memory about batched metadata retrieval and speed:

             

            Speed did not depend much (if at all) on number of photos, but did depend on number of metadata items.

             

            Could this be correct?

             

            Rob

            • 3. Re: Find RAW, Flag as rejected
              Lichtzeichenanlage Level 1

              To  be honest - I have to test it. Mostly (or ever???) I used batch I juggled around with more than von item.

              • 4. Re: Find RAW, Flag as rejected
                johnrellis Most Valuable Participant

                I can't find my notes, but I tested the speed of photo:getRawMetadata() and catalog:batchGetRawMetadata() several months ago.  The former could do about 25 - 50 photos per sec, while the latter could do as fast as 700 per sec.  I also recall that the speed depended on which and how many fields are being fetched, as Rob indicated.   These numbers are from memory (which is usually wrong), but the order-of-magnitude is more likely right.

                • 5. Re: Find RAW, Flag as rejected
                  sschultz lr3 Level 1

                  Thank you. Do you have an answer to the second question, too? "Flag as rejected"

                  Do I have to create a temporary collection "delIfYouHaveTime" instead?

                  • 6. Re: Find RAW, Flag as rejected
                    johnrellis Most Valuable Participant

                    I don't know of any way of setting the flags, but perhaps someone else does.  (You can query them with catalog:findPhotos().)

                    • 7. Re: Find RAW, Flag as rejected
                      john beardsworth Adobe Community Professional & MVP

                      johnrellis wrote:

                       

                      I don't know of any way of setting the flags, but perhaps someone else does.  (You can query them with catalog:findPhotos().)

                      Since an image can have multiple flags, the query would need to include folder or collection names. Maybe begin by calculating the active sources, and extracting relevant containers.

                       

                      John

                      • 8. Re: Find RAW, Flag as rejected
                        areohbee Level 5

                        I doubt there's a straight forward way to set a reject flag, because they are context sensitive, only in the catalog, and not supported via the SDK.

                         

                        A photo can be rejected in one collection but unflagged in another. So, clearly its not associated so much with a photo, but a folder and/or collection. i.e. there is probably a list of photo id's in a folder / collection for the various flag states or something like that.

                         

                        You could figure out how it works using SQLite, not that it would help much necessarily, since you can't manipulate the catalog via SQLite with Lr3 running.

                         

                        Certainly your idea of a "reject collection" may be a work-around, but another idea is to use a keyboard stuffer:

                         

                        it would be easy enough to use vbscript/send-key on windows to pick and reject. On Mac, you can write an applescript to do it.