diff --git a/autotests/read/hdr/rgb-landscape.hdr b/autotests/read/hdr/rgb-landscape.hdr new file mode 100755 index 0000000..a246f87 Binary files /dev/null and b/autotests/read/hdr/rgb-landscape.hdr differ diff --git a/autotests/read/hdr/rgb-landscape.png b/autotests/read/hdr/rgb-landscape.png new file mode 100755 index 0000000..1da6ff1 Binary files /dev/null and b/autotests/read/hdr/rgb-landscape.png differ diff --git a/autotests/read/hdr/rgb-portrait.hdr b/autotests/read/hdr/rgb-portrait.hdr new file mode 100755 index 0000000..d22b12d Binary files /dev/null and b/autotests/read/hdr/rgb-portrait.hdr differ diff --git a/autotests/read/hdr/rgb-portrait.png b/autotests/read/hdr/rgb-portrait.png new file mode 100644 index 0000000..129cb98 Binary files /dev/null and b/autotests/read/hdr/rgb-portrait.png differ diff --git a/src/imageformats/hdr.cpp b/src/imageformats/hdr.cpp index cf468c0..1a686bb 100644 --- a/src/imageformats/hdr.cpp +++ b/src/imageformats/hdr.cpp @@ -227,8 +227,15 @@ bool HDRHandler::read(QImage *outImage) qCDebug(HDRPLUGIN) << "Invalid HDR file, the first line after the header didn't have the expected format:" << line; return false; } - const int width = match.captured(2).toInt(); - const int height = match.captured(4).toInt(); + + if ( (match.captured(1).at(1) != u'Y') || + (match.captured(3).at(1) != u'X') ) { + qCDebug(HDRPLUGIN) << "Unsupported image orientation in HDR file."; + return false; + } + + const int width = match.captured(4).toInt(); + const int height = match.captured(2).toInt(); QDataStream s(device());