Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to handle existing filename would be very valuable #9

Closed
TotallyInformation opened this issue Jul 20, 2015 · 6 comments
Closed
Assignees

Comments

@TotallyInformation
Copy link

Hi, Just started trying to use your library to handle my needs for renaming camera files for archiving.

However, I'm already discovering that I will need a custom rename function. The hardest part of that will be to handle file renames that cause a clash. For example, I rename using the following template:

{{datetime}}-{{exif.Model}}.{{ext}}

But photos taken within a second of each other will cause a clashing name. Normally I resolve that by adding an increment to the end but I only want that increment if there is actually a clash.

Would it be possible to extend this library to include a name clash resolution template as well as the standard template? That would need to cope with multiple clashes so an autoincrementing number would be needed as one of the template options.

Incidentally, one of the other issues I have is that some camera's may not have their date/time set correctly. As such, any EXIF date prior to 1990 is unlikely to be valid and should probably raise an exception.

Many thanks for this useful library.
Regards, Julian.

@dylansmith
Copy link
Owner

Hey Julian

Regarding the clashing filenames: that's a great point, I'll look at including something asap.

For the pre-1990 datetimes, would you want it to raise an exception (i.e. stop processing any further images) or would you rather provide a way of dealing with it (ignore, warn, etc)?

Thanks
Dylan

@TotallyInformation
Copy link
Author

Hi Dylan, thanks for the response.

For the datetimes, it would be nice to have an option to skip the file with a warning but the default should be to fail I think? Because renaming loads of files with the date/time an not realising all the data is wrong could be quite devastating. On the other hand, if you are not using the date/time in a rename, you should be able to ignore the issue.

While I have you "on the line" :) some filters for the directory function would be nice! Or being able to use globbing in the file name for the rename function? Being able to restrict to a file pattern would save the effort of doing it ourselves since the folder might also contain PDF, TXT, video and other files that shouldn't be processed. Or might just contain some files I don't want processing so I might want to process something like:

DSC????.JPG

or

img*.jpg

Great tool though and the best so far of the Node.JS exif tools. Thanks.

@TotallyInformation
Copy link
Author

Oops, pressed the wrong button!

@dylansmith
Copy link
Owner

Update: haven't forgotten about this. Hoping to get some time in the next 2 weeks to address it. I appreciate your patience.

@dylansmith dylansmith self-assigned this Jul 28, 2015
@dylansmith
Copy link
Owner

I know, I suck. But I'm still planning to look at this.

dylansmith added a commit that referenced this issue Oct 20, 2015
@dylansmith
Copy link
Owner

@TotallyInformation can you take a look at https://github.com/dylansmith/node-exif-renamer/tree/1.2.0 and see if it solves your issues?

@dylansmith dylansmith mentioned this issue Jan 15, 2018
dylansmith added a commit that referenced this issue Jan 15, 2018
* fixed #9 by adding sequential filename generation for conflicting filepaths; reduced test/demo images

* #9: added support for globs in rename_dir and --glob flag

* improve detection of file creation time (#10)

* fix file creation calc, add better test

* updated deps, removed Grunt for tooling

* remove grunt dep, updated exif-parser

* updated README

* updated README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants