Building upon the above procedure I came up with a simple plugin for mapivi that does actually the derivation of files resulting in the above directory layout.

Additionally, finding that The Gimp isn't too careful with my metadata the script also learned to copy metadata from the original file to the target file by means of exiftool-library.

The plugin works as follows:
- Select images where derivatives should be created
- Call Derive files
- All files get copied to a parallel structure with D instead of R as outlined above
- If a D-file already exists it is not overwritten by the contents of the R-file but instead only the metadata get propagated.

Here is the essence of the code required.

#!/usr/bin/perl -w

use strict;
use warnings;
use diagnostics;

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

my $nr = @ARGV;
my $dir = $ARGV[0];
if (-d $dir) {
print "Error: first argument ($dir) is a valid directory.\nThis Mapivi Plug-In is developed for Mapivi version >= 0.7.5\n";
exit();
}

for (0 .. ($nr-1)) {
my $srcname = $ARGV[$_];
my $dstname = $srcname;
$dstname =~ s#/R#/D#g;
my $srcdir = dirname($srcname);
my $dstdir = dirname($dstname);
mkpath($dstdir);
if (-e $dstname) {
my $exifTool = new Image::ExifTool;
my $info = $exifTool->SetNewValuesFromFile($srcname);
my $result = $exifTool->WriteInfo($dstname);
}
else {
copy($srcname, $dstname);
}
}
exit();