diff --git a/autotests/read/pfm/comment_gray_half.phm b/autotests/read/pfm/comment_gray_half.phm new file mode 100644 index 0000000..5597a00 Binary files /dev/null and b/autotests/read/pfm/comment_gray_half.phm differ diff --git a/autotests/read/pfm/comment_gray_half.phm.json b/autotests/read/pfm/comment_gray_half.phm.json new file mode 100644 index 0000000..05c6f45 --- /dev/null +++ b/autotests/read/pfm/comment_gray_half.phm.json @@ -0,0 +1,5 @@ +[ + { + "fileName" : "testcard_gray_half.png" + } +] diff --git a/src/imageformats/pfm.cpp b/src/imageformats/pfm.cpp index a04f9ed..e431b2c 100644 --- a/src/imageformats/pfm.cpp +++ b/src/imageformats/pfm.cpp @@ -144,7 +144,10 @@ public: } else { return false; } - auto wh = QString::fromLatin1(d->readLine(128)); + QString wh; + do { // read line and skip comments + wh = QString::fromLatin1(d->readLine(128)); + } while (wh.startsWith(QStringLiteral("#"))); auto list = wh.split(QStringLiteral(" ")); if (list.size() == 1) { m_ps = true; // try for Photoshop version