Bug 420689

Summary: Displays gibberish for certain PBM ASCII files
Product: [Applications] krita Reporter: Aaron Boxer <boxerab>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: minor CC: ghevan, halla, tamtamy.tymona
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: pbm ascii file
pbm with spaces

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.