postprocess: use the proper file extension when using dcraw
Instead of simply appending ".tiff" to the existing filename (like `dcraw_emu` does), `dcraw` fully replaces the file extension, leading `convert` to subsequently fail as it can't find the `.dng.tiff` file.
This commit is contained in:
parent
019771402c
commit
1872efd3d9
|
@ -19,7 +19,7 @@ fi
|
||||||
BURST_DIR="$1"
|
BURST_DIR="$1"
|
||||||
TARGET_NAME="$2"
|
TARGET_NAME="$2"
|
||||||
|
|
||||||
MAIN_PICTURE="$BURST_DIR"/1.dng
|
MAIN_PICTURE="$BURST_DIR"/1
|
||||||
|
|
||||||
# Copy the first frame of the burst as the raw photo
|
# Copy the first frame of the burst as the raw photo
|
||||||
cp "$BURST_DIR"/1.dng "$TARGET_NAME.dng"
|
cp "$BURST_DIR"/1.dng "$TARGET_NAME.dng"
|
||||||
|
@ -34,6 +34,7 @@ fi
|
||||||
|
|
||||||
# Create a .jpg if raw processing tools are installed
|
# Create a .jpg if raw processing tools are installed
|
||||||
DCRAW=""
|
DCRAW=""
|
||||||
|
TIFF_EXT="dng.tiff"
|
||||||
if command -v "dcraw_emu" > /dev/null
|
if command -v "dcraw_emu" > /dev/null
|
||||||
then
|
then
|
||||||
DCRAW=dcraw_emu
|
DCRAW=dcraw_emu
|
||||||
|
@ -43,6 +44,7 @@ fi
|
||||||
if command -v "dcraw" > /dev/null
|
if command -v "dcraw" > /dev/null
|
||||||
then
|
then
|
||||||
DCRAW=dcraw
|
DCRAW=dcraw
|
||||||
|
TIFF_EXT="tiff"
|
||||||
set --
|
set --
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -52,24 +54,24 @@ if [ -n "$DCRAW" ]; then
|
||||||
# -o 1 Output in sRGB colorspace
|
# -o 1 Output in sRGB colorspace
|
||||||
# -q 3 Debayer with AHD algorithm
|
# -q 3 Debayer with AHD algorithm
|
||||||
# -T Output TIFF
|
# -T Output TIFF
|
||||||
$DCRAW +M -H 4 -o 1 -q 3 -T "$@" "$MAIN_PICTURE"
|
$DCRAW +M -H 4 -o 1 -q 3 -T "$@" "$MAIN_PICTURE.dng"
|
||||||
|
|
||||||
# If imagemagick is available, convert the tiff to jpeg and apply slight sharpening
|
# If imagemagick is available, convert the tiff to jpeg and apply slight sharpening
|
||||||
if command -v convert > /dev/null
|
if command -v convert > /dev/null
|
||||||
then
|
then
|
||||||
convert "$MAIN_PICTURE".tiff -sharpen 0x1.0 "$TARGET_NAME.jpg"
|
convert "$MAIN_PICTURE.$TIFF_EXT" -sharpen 0x1.0 "$TARGET_NAME.jpg"
|
||||||
|
|
||||||
# If exiftool is installed copy the exif data over from the tiff to the jpeg
|
# If exiftool is installed copy the exif data over from the tiff to the jpeg
|
||||||
# since imagemagick is stupid
|
# since imagemagick is stupid
|
||||||
if command -v exiftool > /dev/null
|
if command -v exiftool > /dev/null
|
||||||
then
|
then
|
||||||
exiftool -tagsFromfile "$MAIN_PICTURE".tiff \
|
exiftool -tagsFromfile "$MAIN_PICTURE.$TIFF_EXT" \
|
||||||
-software="Megapixels" \
|
-software="Megapixels" \
|
||||||
-overwrite_original "$TARGET_NAME.jpg"
|
-overwrite_original "$TARGET_NAME.jpg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
cp "$MAIN_PICTURE".tiff "$TARGET_NAME.tiff"
|
cp "$MAIN_PICTURE.$TIFF_EXT" "$TARGET_NAME.tiff"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue