Bug 420689 - Displays gibberish for certain PBM ASCII files
Summary: Displays gibberish for certain PBM ASCII files
Status: RESOLVED UPSTREAM
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-28 01:47 UTC by Aaron Boxer
Modified: 2021-03-17 16:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
pbm ascii file (293.52 KB, image/x-portable-bitmap)
2020-04-28 01:47 UTC, Aaron Boxer
Details
pbm with spaces (582.74 KB, image/x-portable-bitmap)
2020-04-28 21:43 UTC, vanyossi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Boxer 2020-04-28 01:47:06 UTC
Created attachment 127933 [details]
pbm ascii file

Simply load the attached "fox" image and you will immediately see the problem.

The header is :

P1
# CREATOR: pbmtovbm version 1.99
617 480

So either Krita doesn't handle the comment, or doesn't handle the line break.
Comment 1 Halla Rempt 2020-04-28 09:20:27 UTC
I can confirm that Krita cannot load the image, while imagemagick can. I see that gwenview has similar problems.
Comment 2 vanyossi 2020-04-28 21:43:45 UTC
Created attachment 127963 [details]
pbm with spaces

pbm version "P1" opens incorrectly as we are not ignoring whitespace as the spec says.

The same file with space added opens as expected.
Comment 3 Tiar 2021-03-17 15:59:54 UTC
We read pbm files with QImage though, and I don't see anything where we could specify whether we should ignore whitespace or not.
Comment 4 Halla Rempt 2021-03-17 16:12:44 UTC
Yes, we used to have our own filters, but it wasn't worth the effort to maintain those, so this needs to be fixed in Qt.