New feature: user commands

Hi,

Thanks!

When i start the script Gimp gives: Aanroepfout voor procedure ‘gimp-file-load’:
Fout bij het openen van bestand ‘/tmp/gimp/2.10/gimp-temp-42000.exr’

Google translation: Call error for procedure ‘gimp-file-load’:
Error opening file ‘/tmp/gimp/2.10/gimp-temp-42000.exr’

(and /tmp/gimp/2.10/ is empthy

Are you trying to open raw files directly? If so, I’d run through ART-cli first. Something like this:

#!/bin/bash

if [ "$1" = "--fast" ]; then
    fast=-f
    shift
fi

d=$(mktemp -d)
t=$d/p1.arp
cat <<EOF > $t
[Version]
Version=1015

[Color Management]
OutputProfile=(none)
EOF

ART-cli --progress $fast -s -p $t -Y -t -b32 -c "$@" 2>"$d/error" \
    | zenity --width=500 --progress --auto-close --text="Converting to TIFF..."

if [ $? -ne 0 ]; then
    exit 0
fi

err=
if [ -f "$d/error" ]; then
    err=$(cat "$d/error")
fi

rm -rf $d

if [ "$err" != "" ]; then
    zenity --error --text="$err"
else
    i=0
    for fn in "$@"; do
        tiffs[$i]="${fn%.*}.tif"
        i=$(expr $i + 1)
    done

    ./gimp-open-layers.sh "${tiffs[@]}" || zenity --error --text="Something went wrong..."
fi

Note that this assumes that you have called the previous script gimp-open-layers.sh, and that it is in the same directory as the one above, which you can call e.g. gimp-open-layers-raw.sh.

Then, here’s the related user command:

[ART UserCommand]
Label=Open as layers in GIMP
Command=./gimp-open-layers-raw.sh
FileType=raw

HTH

1 Like

Hi,

it worked! :slight_smile:
(I changed also ART-cli " {sidecar [@]}" -p t -Y -t -b16 to: b8)

Also with this extra addition it is very nice and efficient to work with ART.