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

Same Filename handling #4

Open
mawosch opened this issue Apr 17, 2013 · 1 comment
Open

Same Filename handling #4

mawosch opened this issue Apr 17, 2013 · 1 comment

Comments

@mawosch
Copy link

mawosch commented Apr 17, 2013

After transfering some pictures I formated the Eye-Fi card. Then started again with shooting and transfering.
The camera gave pictures the same filename.
The problem was solved by the software to add a ".1" behind file extension. Thats a problem for normal file handling on computers.
Could you change the renaming behaviour to "DoubleFilename-A.jpg" or somthing like that?

@kristofg
Copy link
Owner

Hm, yeah, that's true. I've set all my cameras to use sequential file names (ie. don't reset the counter when the card is emptied), so all my .1 files tend to be duplicates. I haven't really considered the use case where you want to keep both versions.

I'm a bit sceptical of messing about "inside" the file names; a trailing .1 is easy to identify and remove. foo123.jpg -> foo123-A.jpg / foo123-1.jpg / foo123+1.jpg can be much harder to identify unambigously (depending on the camera naming scheme, of course). But that may be too much paranoia. I'll have to think about it for a bit.

To solve your immediate problem, the sprintf() call in RIFEC::File::_link_file() would be the place to look. For your use case, I'm guessing you could change the single sprintf() to something like this (Note: this code is NOT TESTED):

my ($base, $ending) = split /\./, $destination_name, 2;
my $newbase = sprintf("%s+%d", $base, ++$tries);
$dst = join('.', $newbase, $ending);

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

No branches or pull requests

2 participants