Bug 409714 - Krita incorrectly parses NetPBM images, converting them results in crash
Summary: Krita incorrectly parses NetPBM images, converting them results in crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: File formats (show other bugs)
Version: 4.2.1
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-11 11:53 UTC by amyspark
Modified: 2019-07-29 08:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample image from Wikipedia (196 bytes, application/octet-stream)
2019-07-11 11:54 UTC, amyspark
Details
Sample image from the tutorial (chapter 11) (225.48 KB, application/octet-stream)
2019-07-11 11:55 UTC, amyspark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amyspark 2019-07-11 11:53:56 UTC
SUMMARY

Krita 4.2.1 in Windows 10 is unable to read properly NetPBM images, it shows them as a 0xN image OR a NxM image with incorrect colors.

However, the thumbnail in the Recent Files section is correct.

Attempting to convert such an image after opening results in a crash (Krita closes without a DrMingw dialog).

I attach two samples. One of them was extracted from the Wikipedia page on NetPB, and the other was generated following the tutorial mentioned below.

STEPS TO REPRODUCE
1. Follow the tutorial here https://in1weekend.blogspot.com/, or grab a P3 ASCII image online.
2. Open any of them with Krita.
3. Close the image.

OBSERVED RESULT

Recent Files displays correctly the image thumbnail, as opposed to the canvas.

If you try converting the image, Krita will crash.


EXPECTED RESULT

Everything works correctly.


SOFTWARE/OS VERSIONS

Windows: Windows 10 v1809
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 amyspark 2019-07-11 11:54:29 UTC
Created attachment 121466 [details]
Sample image from Wikipedia
Comment 2 amyspark 2019-07-11 11:55:11 UTC
Created attachment 121467 [details]
Sample image from the tutorial (chapter 11)
Comment 3 Halla Rempt 2019-07-19 20:19:12 UTC
Git commit 59a2e1f379ca37e27d39c25cfbf20c36eda082ae by Boudewijn Rempt.
Committed on 19/07/2019 at 20:19.
Pushed by rempt into branch 'master'.

Replace our own ppm filter with the qimageio filter

This means we no longer load 16 bit ppm files, but that should
be fixed in a next commit, since QImage supports 16 bit these
days.

M  +0    -1    libs/ui/CMakeLists.txt
D  +0    -84   libs/ui/KisFilterEntry.cpp
D  +0    -102  libs/ui/KisFilterEntry.h
M  +0    -1    plugins/impex/CMakeLists.txt
D  +0    -27   plugins/impex/ppm/CMakeLists.txt
D  +0    -317  plugins/impex/ppm/kis_ppm_export.cpp
D  +0    -59   plugins/impex/ppm/kis_ppm_export.h
D  +0    -320  plugins/impex/ppm/kis_ppm_import.cpp
D  +0    -40   plugins/impex/ppm/kis_ppm_import.h
D  +0    -61   plugins/impex/ppm/kis_wdg_options_ppm.ui
D  +0    -76   plugins/impex/ppm/krita_ppm.desktop
D  +0    -15   plugins/impex/ppm/krita_ppm_export.json
D  +0    -15   plugins/impex/ppm/krita_ppm_import.json
D  +0    -11   plugins/impex/ppm/tests/CMakeLists.txt
D  +0    -0    plugins/impex/ppm/tests/data/incorrectFormatFile.txt
D  +0    -0    plugins/impex/ppm/tests/data/readonlyFile.txt
D  +-    --    plugins/impex/ppm/tests/data/results/j.pbm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test2.pgm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test2.ppm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test3.pgm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test3.ppm.png
D  +0    -12   plugins/impex/ppm/tests/data/sources/j.pbm
D  +-    --    plugins/impex/ppm/tests/data/sources/test2.pgm
D  +-    --    plugins/impex/ppm/tests/data/sources/test2.ppm
D  +0    -3    plugins/impex/ppm/tests/data/sources/test3.pgm
D  +0    -3    plugins/impex/ppm/tests/data/sources/test3.ppm
D  +0    -0    plugins/impex/ppm/tests/data/writeonlyFile.txt
D  +0    -61   plugins/impex/ppm/tests/kis_ppm_test.cpp
D  +0    -35   plugins/impex/ppm/tests/kis_ppm_test.h
M  +2    -2    plugins/impex/qimageio/kis_qimageio_import.cpp
M  +1    -1    plugins/impex/qimageio/krita_qimageio.desktop
M  +2    -2    plugins/impex/qimageio/krita_qimageio_export.json
M  +2    -2    plugins/impex/qimageio/krita_qimageio_import.json

https://invent.kde.org/kde/krita/commit/59a2e1f379ca37e27d39c25cfbf20c36eda082ae
Comment 4 Halla Rempt 2019-07-29 08:35:39 UTC
Git commit 02b05aa05d038f197d257923d9841b091b3dfe1a by Boudewijn Rempt.
Committed on 29/07/2019 at 08:33.
Pushed by rempt into branch 'krita/4.2'.

Replace our own ppm filter with the qimageio filter

This means we no longer load 16 bit ppm files, but that should
be fixed in a next commit, since QImage supports 16 bit these
days.

M  +0    -1    libs/ui/CMakeLists.txt
D  +0    -84   libs/ui/KisFilterEntry.cpp
D  +0    -102  libs/ui/KisFilterEntry.h
M  +0    -1    plugins/impex/CMakeLists.txt
D  +0    -27   plugins/impex/ppm/CMakeLists.txt
D  +0    -317  plugins/impex/ppm/kis_ppm_export.cpp
D  +0    -59   plugins/impex/ppm/kis_ppm_export.h
D  +0    -320  plugins/impex/ppm/kis_ppm_import.cpp
D  +0    -40   plugins/impex/ppm/kis_ppm_import.h
D  +0    -61   plugins/impex/ppm/kis_wdg_options_ppm.ui
D  +0    -76   plugins/impex/ppm/krita_ppm.desktop
D  +0    -15   plugins/impex/ppm/krita_ppm_export.json
D  +0    -15   plugins/impex/ppm/krita_ppm_import.json
D  +0    -11   plugins/impex/ppm/tests/CMakeLists.txt
D  +0    -0    plugins/impex/ppm/tests/data/incorrectFormatFile.txt
D  +0    -0    plugins/impex/ppm/tests/data/readonlyFile.txt
D  +-    --    plugins/impex/ppm/tests/data/results/j.pbm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test2.pgm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test2.ppm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test3.pgm.png
D  +-    --    plugins/impex/ppm/tests/data/results/test3.ppm.png
D  +0    -12   plugins/impex/ppm/tests/data/sources/j.pbm
D  +-    --    plugins/impex/ppm/tests/data/sources/test2.pgm
D  +-    --    plugins/impex/ppm/tests/data/sources/test2.ppm
D  +0    -3    plugins/impex/ppm/tests/data/sources/test3.pgm
D  +0    -3    plugins/impex/ppm/tests/data/sources/test3.ppm
D  +0    -0    plugins/impex/ppm/tests/data/writeonlyFile.txt
D  +0    -61   plugins/impex/ppm/tests/kis_ppm_test.cpp
D  +0    -35   plugins/impex/ppm/tests/kis_ppm_test.h
M  +2    -2    plugins/impex/qimageio/kis_qimageio_import.cpp
M  +1    -1    plugins/impex/qimageio/krita_qimageio.desktop
M  +2    -2    plugins/impex/qimageio/krita_qimageio_export.json
M  +2    -2    plugins/impex/qimageio/krita_qimageio_import.json

https://invent.kde.org/kde/krita/commit/02b05aa05d038f197d257923d9841b091b3dfe1a