#10 Renaming on ingest

closed
nobody
None
3
2010-10-20
2009-11-02
Anonymous
No

Though raw support is not the primary target of mapivi it usually moves the raws around accordingly. However, this procedure breaks if smart renaming is used on import as the raw files do not undergo smart renaming procedure.

Example:
DSC_0123.JPG
DSC_0123.NEF

reside on the memory card. Upon ingest files are renamed by the pattern R%y%m%d-%F5-8. This results in two files like R20091101-0123.jpg and DSC_0123.NEF and mapivi is lost with the pending raw.

The following perl plugin can accomplish this:

-----------------------------------------------------------
use Image::ExifTool qw(:Public);
use File::Copy;
use File::Basename;
use diagnostics;

foreach my $imagefile (@ARGV) {

my($filename, $directories, $suffix) = fileparse($imagefile);

my $exifTool = new Image::ExifTool;
my $info = $exifTool->ImageInfo($imagefile);

my @Comments = $exifTool->GetValue('Comment', 'ValueConv');

foreach $k (@Comments) {
$base = $imagefile;
$base =~ s/\.JPG$//;
$base =~ s/\.jpg$//;
if (-e "$directories$k.NEF") {
# print "Renaming $directories$k.NEF => $base.nef\n";
move("$directories$k.NEF", "$base.nef");
}
}
}
-----------------------------------------------------------

Discussion

  • Martin Herrmann

    Martin Herrmann - 2010-02-10
    • priority: 5 --> 3
    • status: open --> open-fixed
     
  • Martin Herrmann

    Martin Herrmann - 2010-02-10

    This feature is now available in the SVN rev 47.
    Implementation has been done by using an existing sub, not the proposed perl plugin.
    Please let me know if it works for you.

     
  • Martin Herrmann

    Martin Herrmann - 2010-02-10
    • status: open-fixed --> open
     
  • Nobody/Anonymous

    Thanks for this fix! :) Actually the perl plugin was merely meant to show what I want mapivi to do. Using existing sub is of course the cleaner way to do it.

     
  • Nobody/Anonymous

    Did some further tries. I think the issue can be closed.

     
  • Martin Herrmann

    Martin Herrmann - 2010-10-20
    • status: open --> closed
     
  • Martin Herrmann

    Martin Herrmann - 2010-10-20

    This feature is implemented and tested.

     

Log in to post a comment.