Closed Beep6581 closed 8 years ago
The attached patch seems to work.
diff --git a/ImageIO.cpp b/ImageIO.cpp
index 6377c55..64a2923 100644
--- a/ImageIO.cpp
+++ b/ImageIO.cpp
@@ -39,10 +39,12 @@ Image ImageIO::loadRawImage(RawParameters & rawParameters) {
if (rawProcessor.open_file(rawParameters.fileName.toLocal8Bit().constData()) == LIBRAW_SUCCESS) {
libraw_decoder_info_t decoder_info;
rawProcessor.get_decoder_info(&decoder_info);
- if(!decoder_info.decoder_flags & LIBRAW_DECODER_FLATFIELD) {
- Log::msg(Log::DEBUG, "LibRaw decoder is not flatfield (", ios::hex, decoder_info.decoder_flags, ").");
- } else if (d.idata.filters <= 1000 && d.idata.filters != 9) {
+ if (d.idata.filters <= 1000 && d.idata.filters != 9) {
Log::msg(Log::DEBUG, "Unsupported filter array (", d.idata.filters, ").");
+#ifdef LIBRAW_DECODER_FLATFIELD
+ } else if (!decoder_info.decoder_flags & LIBRAW_DECODER_FLATFIELD) {
+ Log::msg(Log::DEBUG, "LibRaw decoder is not flatfield (", ios::hex, decoder_info.decoder_flags, ").");
+#endif
} else if (rawProcessor.unpack() != LIBRAW_SUCCESS) {
Log::msg(Log::DEBUG, "LibRaw::unpack() failed.");
} else {
Compiling using libraw-0.17.* will fail with:
What OpenImageIO did about this: https://github.com/OpenImageIO/oiio/pull/1204 What LIBRAW_DECODER_FLATFIELD is: http://www.libraw.org/docs/API-datastruct-eng.html