tomkyle / negatives-linear-tiff

Converts RAW/NEF/CR2 files into linear TIFF files, using GNU Parallel for maximum speed. Other features: B/W grayscaling, TIF resizing and ZIP compression.
https://tomkyle.github.io/negatives-linear-tiff
Other
7 stars 1 forks source link

Replace dcraw with libraw's dcraw_emu? #16

Open tomkyle opened 7 years ago

tomkyle commented 7 years ago

Just saw it seems libraw's _dcrawemu command is about one third faster than dcraw. Should one try?

tomkyle commented 7 years ago

When running with dcraw_emu, mogrify will complain:

mogrify: ASCII value for tag "ImageDescription" contains null byte in value; value incorrectly truncated during reading due to implementation limitations. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/925.
mogrify: ASCII value for tag "Make" contains null byte in value; value incorrectly truncated during reading due to implementation limitations. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/925.
mogrify: ASCII value for tag "Model" contains null byte in value; value incorrectly truncated during reading due to implementation limitations. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/925.
mogrify: ASCII value for tag "Software" contains null byte in value; value incorrectly truncated during reading due to implementation limitations. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/925.
mogrify: ASCII value for tag "Artist" contains null byte in value; value incorrectly truncated during reading due to implementation limitations. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/925.

It seems, setting the meta data entries to empty string can fix this:

exiftool -overwrite_original \
-mwg:Description="" \
-mwg:Creator="" \
-make="" \
-model="" \
-software="" \
"${output_tiff}" > /dev/null
tomkyle commented 7 years ago

Solution currently looks like this: try to copy missing meta data from existing tags

declare -a exiftool_fix_missing_metadata=(
    "-mwg:Description="""
    "-mwg:Creator="""
    "-Artist<mwg:Creator"
    "-Make<exif:Make"
    "-Model<exif:model"
    "-Software<exif:software"
)

exiftool -overwrite_original -quiet "${exiftool_fix_missing_metadata[@]}" "${output_tiff}"