Page 1 of 1

Give HashTool an option to rename the file with the hash.

Posted: Tue Jan 19, 2021 8:46 pm
by Acura Photos
Many of my image files have inconsistent naming. Having the hash for the file name would be great way to:
/1 disambiguate the image files
/2 create a unique name that doubles as an integrity check.

I would use this today on a tree of 150K image files.

Extra credit:

Allowing a prefix would be helpful. Like "bob-ec55d3e698d289f2afd663725127bace.jpg"
Additionally, an option to use the directory name as the prefix would be perfect.

.\bob\something.jpg
would be come
.\bob\bob-ec55d3e698d289f2afd663725127bace.jpg

Re: Give HashTool an option to rename the file with the hash.

Posted: Wed Jan 20, 2021 9:40 am
by DigitalVolcano
Duplicate Cleaner 5 (beta) will be able do this -

You'd create a scan with all files -
Find Duplicates=No
Find Remaining=Yes

Rename marked files (with hash flag in prefix or suffix) (/h)

Re: Give HashTool an option to rename the file with the hash.

Posted: Wed Jan 20, 2021 3:40 pm
by Acura Photos
That's great, thank you.
Any chance of getting some macros in there for the prefix? Like $FOLDERNAME for example? :)

Re: Give HashTool an option to rename the file with the hash.

Posted: Wed Jan 20, 2021 4:10 pm
by Acura Photos
Heh, one last idea here...

Add the ability to match name replacements with a regular expression.
For instance, I want to replace all bad names like "02 (42).jpg", but not "Bob's 12th birthday.jpg"
Regular expressions would allow for this.

Re: Give HashTool an option to rename the file with the hash.

Posted: Sat Jan 23, 2021 2:01 pm
by Acura Photos
So, ideally, you would match via regular expression, and construct the output file name with $ macros something like this:

Match: [regular expression here] // if matched

output: $FOLDER-$HASH.$EXT // example 1

output: "My Prefix"-$HASH.$EXT // example 2

output: $HASH-"my postfix".$EXT // example 2