PFM: fix error when loading images with comments

I tested the plugin with the images stored [here](https://github.com/walbourn/directxtexmedia). It contains PFM and PHM images but I didn't find any license on the repo, so the images was not added to test cases.

I attach here the images that this patch allows to load:
[grad4d_mono.pfm](/uploads/6e41fcb64d0651a6abd78cffc5ff86b2/grad4d_mono.pfm)
[grad4d_mono.phm](/uploads/348a51476068aa344f67826006cb65c4/grad4d_mono.phm)
[grad4d.phm](/uploads/2ab8330466f4dd0fc2fda00711270ce9/grad4d.phm)
This commit is contained in:
Mirco Miranda 2024-12-12 09:48:34 +00:00 committed by Albert Astals Cid
parent ecbcf3b7f4
commit 86865223d2
3 changed files with 9 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1,5 @@
[
{
"fileName" : "testcard_gray_half.png"
}
]

View File

@ -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