<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hello,<br>
<br>
I'm struggling with custom script for image import. I had this
working in the past (2+ years back, cannot remind exactly when, and
IIRC that was on Windows, now I'm on Linux).<br>
I've been trying with digiKam 8.2.0 and 8.3.0 - with the exact same
result.<br>
What I'm trying to achieve is to import images from a directory -
only jpeg's, renaming them on the fly, and copying raw files to
another directory (and also rename them accordingly).<br>
I use the Import -> Add Images. Then I select JPG/TIFF on the
bottom selector. Then in the right tab: Settings - for the rename I
have something like:<br>
<span style="white-space: pre-wrap">ALBUMNAME-[date:"yyyyMMdd-hhmmss"]{unique}.[ext]{lower}{removedoubles}</span><br>
<span style="white-space: pre-wrap">and for the Scripts:</span><br>
<span style="white-space: pre-wrap">~/digikam-raw-archive.sh "%orgpath" "%orgfilename" "%filename"</span><br>
<span style="white-space: pre-wrap"></span><span
style="white-space: pre-wrap">And I have the rotage jpegs automatically also selected.</span><br>
<span style="white-space: pre-wrap"></span><br>
<span style="white-space: pre-wrap"></span><span
style="white-space: pre-wrap">The script itself:</span><br>
<pre><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">#!/bin/bash
</span>RAWDIR=/something/RAW
fp="$1"
orgfilename=$(basename -- "$2")
ext="${orgfilename##*.}"
fn="${orgfilename%.*}"
filename=$(basename -- "$3")
ext2="${filename##*.}"
fn2="${filename%.*}"
if [ -f "${fp}${fn}.PEF" ]; then cp "${fp}${fn}.PEF" "$RAWDIR/${fn2}.pef"; fi #Pentax
if [ -f "${fp}${fn}.CR3" ]; then cp "${fp}${fn}.CR3" "$RAWDIR/${fn2}.cr3"; fi #Canon
if [ -f "${fp}${fn}.RW2" ]; then cp "${fp}${fn}.RW2" "$RAWDIR/${fn2}.rw2"; fi #Panasonic
exit 0</span></pre>
<pre><span style="font-family:monospace"></span></pre>
<br>
And the issue is, that the %filename in that case is not the renamed
filename (which I believe it was some time ago), but e.g.:<br>
<span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">Camera-dwflqi-c0640a26.digikamtempfile.P100019</span>4.rw2</span><br>
<span style="font-family:monospace"></span><br>
I was thinking, maybe the "rotate jpegs on the fly" is responsible,
but no - disabling it has no effect.<br>
jpegs are imported with correct "renamed" name (although, when
importing a large number of them, I can see, that at first, they are
imported to the destination directory with those "digikamtempfile"
name, and are renamed later on).<br>
<br>
Is this how this should work? I'm not sure if this is a bug worth
submitting, or feature, or I'm simply doing something wrong...<br>
<br>
Best regards<br>
PaBre<br>
</body>
</html>