The current HDR stacker is incredibly buggy and was only
added so it can be quickly be tested by building/installing it
locally. Some distributions have actually packaged this buggy mess
and made it a dependency of megapixes meaning the whole experience
is broken for users.
This drops support for trying to use stack_frames by default so
hdr-plus being installed for users doesn't break/corrupt photos.
As `dcraw_emu` is an example program, Debian doesn't install it to
`/usr/bin`, but to `/usr/lib/libraw` instead, meaning it can't be found
the usual way.
This patch checks for `/usr/lib/libraw/dcraw_emu` if `command` can't
find it. Additionnally, cascaded if's are replaced with if..elif
statements, so we stop searching as soon as a matching program
(preferably `dcraw_emu`) is found.
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.
Redirecting streams using `&>` is not POSIX-compliant. This causes some
shells (such as `dash`) to evaluate `if` conditions the wrong way.
Sticking to standard `>` redirection fixes this issue.