Script-based filters for filtering out sub-versions

vlad
Posts: 895
Joined: 01 Sep 08 14:20

Script-based filters for filtering out sub-versions

Post by vlad »

Given the recurring posts, questions and occasional confusion (affecting mostly - but not exclusively - new users) about how versions are displayed or should be displayed, I would like to let you know about two filter scripts that I wrote several months ago. The scripts are potentially helpful for any image collection that displays at least certain image sub-versions as seperate thumbnails. (For a detailed list of situations involving such collections, please see this very helpful post from Mike Buckley.) In the view modes that always display only main versions and non-versioned images, the scripts have no effect.

Filter Out Redundant SubVersions filters out the thumbnails for all sub-versions of an image if the main version belongs to the current collection - otherwise, when there are thumbnails for multiple sub-versions, the filter keeps for display only the first qualifying sub-version. In addition, images outside version sets are always filtered in (kept for display). Basically, this script simulates the view option that myself and others have suggested for collapsing (or expanding) the sub-version thumbnails (for example, in the Folders view).

Filter Out All SubVersions is a one line script which filters out ALL sub-versions (even when there is no main version in the active collection). It has the same effect as the other script (only) in those situations where all the main versions belong to the active collection.

If you try out the scripts, please let me know if they are helpful. (So far, I have received positive but limited feedback in Mantis, where I originally provided the scripts.)

Regards,
Vlad

P.S. To make PSU recognize the filter scripts, first save them in the "Scripts\FilterScripts" sub folder of the application data folder (e.g. C:\Users\yourname\AppData\Local\IDimager Systems, Inc\Scripts\FilterScripts). If that folder doesn't exist yet then create it yourself. The saved filters will then appear in the FILTER dropdown within the filter bar.
Attachments
Filter Out Redundant SubVersions.psc
Filters out "redundant" sub-versions.
(3.25 KiB) Downloaded 466 times
Filter Out All SubVersions.psc
Filters out all sub-versions.
(438 Bytes) Downloaded 435 times
doug_w
Posts: 22
Joined: 14 Apr 08 2:52

Re: Script-based filters for filtering out sub-versions

Post by doug_w »

Thanks, I will use this.

Just a suggestion, another filter script that I've often wanted is one that filters version sets where the images in the set have different dates (date taken).
photography.dougwieringa.com
vlad
Posts: 895
Joined: 01 Sep 08 14:20

Re: Script-based filters for filtering out sub-versions

Post by vlad »

Hi Doug, on what kind of collections (or in which views) would such a filter work and what exactly should it filter in or out? How do you use version sets for images taken on different dates? Could you provide a brief example of what you have and what you need?
doug_w
Posts: 22
Joined: 14 Apr 08 2:52

Re: Script-based filters for filtering out sub-versions

Post by doug_w »

I would envision the filter working on any view. It would show only version sets in that view where the Date/Time Taken was not the same for all images.

With the way I use versions, all images in a version set should have the same Date/Time Taken, so I would use the script to find and correct mis-dated images. For example, I may have made a mistake and changed an image date but forgot to change the dates for the entire version set. The script would help me track those mistakes down.

doug
photography.dougwieringa.com
vlad
Posts: 895
Joined: 01 Sep 08 14:20

Re: Script-based filters for filtering out sub-versions

Post by vlad »

doug_w wrote:I would envision the filter working on any view. It would show only version sets in that view where the Date/Time Taken was not the same for all images.


When you say "showing version sets", do you actually mean showing multiple version thumbnails for a qualifying version set (assuming multiple version thumbanils are already displayed in the current view) - or just one of the versions (preferentially the main version, unless you have in mind some date-based version selection criteria)? To me, the second implementation appears more useful, since it would only display a version set representative and filter out noise related to multiple versions, but I'm interested in what you have in mind.
doug_w
Posts: 22
Joined: 14 Apr 08 2:52

Re: Script-based filters for filtering out sub-versions

Post by doug_w »

Yes, the second implementation would be the most useful -- just one version thumbnail.

Thanks!
photography.dougwieringa.com
vlad
Posts: 895
Joined: 01 Sep 08 14:20

Re: Script-based filters for filtering out sub-versions

Post by vlad »

Hi Doug, could you clarify which date/time metadata field (or criterion) do you envisage for comparing the versions? Also, could someone point me to the relevant API functions or properties?
doug_w
Posts: 22
Joined: 14 Apr 08 2:52

Re: Script-based filters for filtering out sub-versions

Post by doug_w »

I think Exif.Image.DateTimeOriginal should be compared (I'm not an expert on metadata but that looks right).

Unfortunately I don't know enough about the API to answer your second question -- hopefully someone else can.

doug
photography.dougwieringa.com
vlad
Posts: 895
Joined: 01 Sep 08 14:20

Re: Script-based filters for filtering out sub-versions

Post by vlad »

Hi Doug,

Good news: I have found some time and implemented the script requested by you, despite not finding anything relevant in the API doc and no-one providing any pointers here. (But, hey, how fun is programming if you have proper docs and help? :) )

Images outside version sets are always filtered out. For any version set (fully or partially) displayed in the active collection, the script checks whether all the versions have the same value in %xmp:exif:DateTimeOriginal. (I think you could safely change the occurrence of 'exif:DateTimeOriginal' in the code if you become interested in checking a different field.) If they do, then all versions are filtered out. Otherwise, only one version is preserved for display: the main version, if it belongs to the active collection, otherwise the first qualifying sub-version in the active collection.

(N.B.: The result filtered and displayed by this script is always a subset - possibly empty - of the result that would be returned by FilterOutRedundantSubVersions. That makes the code fairly long and complex. If PSU enabled the application of chained filter scripts, then I woudn't have gone to the trouble of implementing (again) the detection and discarding of redundant versions - unfortunately, this is not possible. Thus, I did implement the behavior that we both agreed would be most useful.)

Please let me know how the script works for you. My testing has been fairly minimal, but successful. (Also, note that I empirically nailed down the code to retrieve and compare exif:DateTimeOriginal, but I don't understand exactly if that is the best implementation. I have asked for API clarifications elsewhere - so I might provide a minor update in case anyone cares to provide the requested details.)

Cheers,
Vlad
Attachments
Filter Version Sets With Inconsistent Dates.psc
Filters version sets with inconsistent dates (exif:DateTimeOriginal)
(6.69 KiB) Downloaded 450 times
doug_w
Posts: 22
Joined: 14 Apr 08 2:52

Re: Script-based filters for filtering out sub-versions

Post by doug_w »

Thanks, Vlad! I just ran this on 8500 images and got almost 900 results. I spot checked and it looks like the script worked fine. Most affected images have matching dates but the time is off (now I wonder how my workflow caused that to happen; most are scanned images, which I dated manually).

Once I clean this up, I'll try modifying the script to check for star ratings and color labels as well.

Also, I use your Filter Redundant Subversions script frequently. It is very helpful (and should be part of Photo Supreme functionality, in my opinion).

Thanks again for doing this. I'll let you know if I see any issues.

doug
photography.dougwieringa.com
fbungarz
Posts: 1826
Joined: 08 Dec 06 4:03
Location: Arizona, USA

Re: Script-based filters for filtering out sub-versions

Post by fbungarz »

Hi Vlad,
I am a bit confused. Where can I get these scripts? It seems they are not attached to your original post???
Thanks,
Frank
fbungarz
Posts: 1826
Joined: 08 Dec 06 4:03
Location: Arizona, USA

Re: Script-based filters for filtering out sub-versions

Post by fbungarz »

PS: Is there a script/filter that filters only the main versions in Folder View?
vlad
Posts: 895
Joined: 01 Sep 08 14:20

Re: Script-based filters for filtering out sub-versions

Post by vlad »

Hi Frank,

Thanks for your interest. Hert informed us a couple of days ago that post attachments are currently disabled, due to a technical problem in the software supporting the forum. It seems that affects olders posts with attachments too.

You can still download my versioning scripts from a Mantis ticket: http://mantis.idimager.com/view.php?id=2525
Just make sure you download Filter Out Redundant SubVersions (fast).psc rather than the slow (non-optimized) variant. There's also a script to filter out all versions.

Please let me know how these scripts work for you.

Cheers,
Vlad
vlad
Posts: 895
Joined: 01 Sep 08 14:20

Re: Script-based filters for filtering out sub-versions

Post by vlad »

fbungarz wrote:PS: Is there a script/filter that filters only the main versions in Folder View?
Filter Out All SubVersions.psc will display the main versions, but any images outside version sets are displayed too. (IOW, all sub-versions are filtered out.) Isn't that suitable for you?
Post Reply