[help] move photos based on cameramodel & other criteria

Discuss and share scripts and script files...
Post Reply
skavan
Posts: 3
Joined: 27 Dec 2014 18:46

[help] move photos based on cameramodel & other criteria

Post by skavan »

Is this an impossible script?

Here's the problem:
1. I have a variety of source loccation(s) of mostly image files. (i.e. G:\Pictures, d:\development\pics).

2. The files are of a variety of types:
  • [a] photos [where camera model or suchlike is present]
    edited photos [where camera model is not present but are located in directories where >50% of files are photos with camera model tags. this might include photoshop files]
    [c] other images

3. I wish to process them as follow:
  • take all unique type [a] and copy them to a target location [say, G:\master photos\] and place them in directory structure based on Photo Taken Date like this: 2003\March or perhaps like this 2003\March\11. Dupes [sha1] should be ignored.
    [ii] take all "edited photos" and do the same but also place a copy in a seperate Target Location [say G:\images], with the subdirectory mirroring the source subdirectory. i.e. if the source was d:\development\pics\001, the target would be g:\images\d\development\pics\001.
    [iii] take all "other images" and copy them to a target directory [say, G:\other images] with source directory structure intact. i.e. if the source was d:\development\pics\009, the target would be g:\other images\d\development\pics\009.

4. Ideally, I would get a report on dupe photos ignored and optionally, to do a "MOVE" rather than a "COPY"

Big ask, but is this even possible in the amazing XYplorer?
Last edited by highend on 28 Dec 2014 00:12, edited 2 times in total.
Reason: re-title

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: [help]move photos based on cameramodel & other criteria

Post by highend »

but is this even possible in the amazing XYplorer?
Sure...
One of my scripts helped you out? Please donate via Paypal

skavan
Posts: 3
Joined: 27 Dec 2014 18:46

Re: [help] move photos based on cameramodel & other criteria

Post by skavan »

at the risk of being too needy, can anyone give me the pseudo code/steps to actually do it?

I couldn't really unpack "sure" into its component parts :)

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: [help] move photos based on cameramodel & other criteria

Post by bdeshi »

I can try my hand at it, but I think it could get slow (depending on how many images/locations you intend to operate on).

What OS are you using?
Alternatively, Go to Config-> file Info Tips and in the big file property list under "show custom file info tips", provide the index number for "Date Taken" and "Camera Model"
unnamed.gif
What I think your script should do is: list all image files in source folder(s), copy all images with camera model tags to one location, other "edited images" to another location and yet another set of "other images" to another set of locations.(ignoring any dupes somehow). Easy enough.

But how does the script separate "edited images" and "other images"? By image formats?
To see the attached files, you need to log into the forum.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: [help] move photos based on cameramodel & other criteria

Post by highend »

I couldn't really unpack "sure" into its component parts
You didn't ask for more than: is this possible xD

As long as there aren't any details I won't touch my Sublime Text...

E.g.
1.
How are these source locations selected, from a list of existing ones (provide the list!), typed in, every location selected by a file requester on it's own, the current folder... etc.

2.
b.
So the script should find out if a folder contains >50% of image files which have that exif property? What happens if the ratio is only 49%?
Might include? Either they are included or not
c.
Other images are defined as what? They are just missing the camera model tag and are not in a folder (>50%)?

General question:
Where in how should you get the option if you want to do a move / copy?

So:
Model the logic of your script. Be as precise as possible. Photos? Great! But... ahem, define the extensions that should be processed^^

I don't want to code something as long it is as vague as it is atm :)
One of my scripts helped you out? Please donate via Paypal

skavan
Posts: 3
Joined: 27 Dec 2014 18:46

Re: [help] move photos based on cameramodel & other criteria

Post by skavan »

OK - I'll try my best (and happy to donate accordingly):
  • 1. In an ideal world user will choose each location from a file requester. (For simplicity, we could limit the # to say, 5). We only care about files >10kb (i.e. ignore thumbs.db etc..)
    2. Files need to be tagged as either (i) photos, (ii) photo edits or (iii) unknown. Relevant extensions are all image tags (jpg, jpeg, gif, tiff, png, psd, pdf, raw, dng, bmp). Anything else should be tagged as (iii) unknown. (i.e. the image wasn't created by a digital camera, so no Camera Model tag exists).
    3. If the 50% rule is not met, the file is tagged as 2(iii). Even if 49%.
    4. The move copy option should be available at the start of this process. Along with the selection of: (i) Photo Root Target Directory, (ii) Other Files Directory
So, the workflow:
  • 1. Set Move or Copy option.
    2. Set Source Directories
    3. Set Target Directories.
    4. Bonus: Set ignored file size threshhold.
    5. Set Target Pattern: Either [Target Directory]\Year\Month or [Target Directory]\Year\Month\Day
    6. Process Part 1: Files are categorized as (i) Photos (i.e Taken with a camera) or (ii) Edited Photos [per 50% rule] or (iii) unknown
    7. Process Part 2: For (i) Photos - Dupes (using SHA-1) are ignored and each unique file is copied/moved according to the Target Pattern. If an entry by that exact name already exists (coincedence as they, by definition, aren't dupes) than a suffix (_1, _2, _3 etc..) should be added
    8. Process Part 3a: For (ii) Edited Photos, each unique file is copied twice. First to the Photos Target Directory as per pattern above [Note: ideally, if identified as an edited Photo, but month and year differ from one (any one) of the actual photos in the directory, the date for purposes of the target pattern should, ideally, be the day, month, date, of one of the other "photos" in the same directory. If in doubt, we should create a new subdirectory under [Photo Root Target Directory] called "Unknown" and then use the actual date of the file.
    9. Process Part 3b: For (ii) Edited Photos, each file, should be copied/moved to the Other Files Directory, appending the source file directory structure.
    10. Process Part 4: Unknown files should be treated as per 8 above.
    11. Ideally, the process will report: (i) Total Files found by extension and in total. (ii) Total Dupes Found, by extention and in total. (iii) Total Unqiue Photos, Total Unique Edited Photos, Total Unknown Files (iv) a log file of all copy, discard (for the dupes) and move operations.
The underlying task is that I have scattered mounds of photos and images, full of dupes. I intend to move them all to one big hard drive and process them with first prize being (i) the master collection of photos and (ii) other files for me to manually sort through. There are probably 60,000 source files to process (overnight or over a weekend!).

I hope that captured the essence of it, above. If this is actually doable, then I will dance a jig, make a donation and still be indebted to the skill of others!

s.

Post Reply