The %filename var used in the import script seems to not work as intended
Maik Qualmann
metzpinguin at gmail.com
Sun Jun 16 14:08:19 BST 2024
Due to many problems, the files are now only actually renamed after import.
Only then are metadata or database options available. The placeholder $filename
is replaced with the file name of the temporary file. However, $orgfilename is
also available. Since the correct renaming name cannot be determined correctly
at this point, it is not available.
Please also note that the files in temporary form may not yet be in their final
location. But I will see if we can run the script later.
Maik
Am Sonntag, 16. Juni 2024, 00:11:55 MESZ schrieb Paweł Breguła:
> Hello,
>
> 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).
> I've been trying with digiKam 8.2.0 and 8.3.0 - with the exact same result.
> 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).
> 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:
> ALBUMNAME-[date:"yyyyMMdd-hhmmss"]{unique}.[ext]{lower}{removedoubles}
> and for the Scripts:
> ~/digikam-raw-archive.sh "%orgpath" "%orgfilename" "%filename"
> And I have the rotage jpegs automatically also selected.
>
> The script itself:
>
> #!/bin/bash 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
>
>
> 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.:
> Camera-dwflqi-c0640a26.digikamtempfile.P1000194.rw2
>
> I was thinking, maybe the "rotate jpegs on the fly" is responsible, but
> no - disabling it has no effect.
> 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).
>
> 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...
>
> Best regards
> PaBre
More information about the Digikam-users
mailing list