Bug 463951 - PCX image issues
Summary: PCX image issues
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.101.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-06 22:59 UTC by fenugrec
Modified: 2023-05-25 21:59 UTC (History)
5 users (show)

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


Attachments
test PCX image that fails with kimageformats, but is correctly opened by gimp (20.12 KB, image/vnd.zbrush.pcx)
2023-01-06 22:59 UTC, fenugrec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fenugrec 2023-01-06 22:59:17 UTC
Created attachment 155083 [details]
test PCX image that fails with kimageformats, but is correctly opened by gimp

SUMMARY
Loading certain pcx files , via a generic image viewer (lximage-qt), produces a black rectangle . The same file can be correctly opened in any recent version of gimp.

Not sure how else to reproduce or troubleshoot this except via general software that uses QImageReader as a backend.


STEPS TO REPRODUCE
1. try any software that uses QImageReader
2. load attached .pcx file

OBSERVED RESULT
black rectangle of the correct size.

EXPECTED RESULT
Correct grayscale image
Comment 1 fenugrec 2023-01-06 23:04:42 UTC
I'm not sure why my initial comment doesn't show up on the summary page here ? Pasting again just in case, sorry if it's duplicate :
***********
SUMMARY
Loading certain pcx files , via a generic image viewer (lximage-qt), produces a black rectangle . The same file can be correctly opened in any recent version of gimp.

Not sure how else to reproduce or troubleshoot this except via general software that uses QImageReader as a backend.


STEPS TO REPRODUCE
1. try any software that uses QImageReader
2. load attached .pcx file

OBSERVED RESULT
black rectangle of the correct size.

EXPECTED RESULT
Correct grayscale image
Comment 2 Tsu Jan 2023-01-06 23:23:11 UTC
KDE's GWenview has the same behavior. The problem is independent of the Qt viewer (I tried 3).
Comment 3 Albert Astals Cid 2023-01-08 23:13:05 UTC
Mirco would you have interest in looking into what may be wrong here?
Comment 4 Mirco Miranda 2023-01-09 00:07:18 UTC
(In reply to Albert Astals Cid from comment #3)
> Mirco would you have interest in looking into what may be wrong here?

Yes, I'll take a look at it.
Comment 5 Mirco Miranda 2023-01-09 22:06:27 UTC
(In reply to fenugrec from comment #0)
> Created attachment 155083 [details]
> test PCX image that fails with kimageformats, but is correctly opened by gimp

We have a fix for your bug report. Can we use this image in ours test case? It's free of any copyrights?
Comment 6 fenugrec 2023-01-10 14:32:13 UTC
(In reply to Mirco Miranda from comment #5)
> We have a fix for your bug report. Can we use this image in ours test case?
> It's free of any copyrights?

Already ! that was fast, thanks. Yes, you may use the image without restriction.
Comment 7 Albert Astals Cid 2023-01-11 22:56:42 UTC
Git commit 14742cb502272b8029103ce10148dfe5d0317e80 by Albert Astals Cid, on behalf of Mirco Miranda.
Committed on 11/01/2023 at 22:56.
Pushed by aacid into branch 'master'.

PCX: Fix reading of the extended palette

The VGA palette starts 769 bytes before the end of the file. There may be PADs between the end of the image and the start of the palette.

A  +-    --    autotests/read/pcx/ccbug_463951.pcx
A  +-    --    autotests/read/pcx/ccbug_463951.png
M  +14   -3    src/imageformats/pcx.cpp

https://invent.kde.org/frameworks/kimageformats/commit/14742cb502272b8029103ce10148dfe5d0317e80
Comment 8 Albert Astals Cid 2023-05-25 21:59:31 UTC
Git commit bb66367bc82bd656150792da6eef1076f0cf69b5 by Albert Astals Cid, on behalf of Mirco Miranda.
Committed on 25/05/2023 at 21:58.
Pushed by aacid into branch 'kf5'.

PCX: Fix reading of the extended palette

The VGA palette starts 769 bytes before the end of the file. There may be PADs between the end of the image and the start of the palette.
(cherry picked from commit 14742cb502272b8029103ce10148dfe5d0317e80)

A  +-    --    autotests/read/pcx/ccbug_463951.pcx
A  +-    --    autotests/read/pcx/ccbug_463951.png
M  +14   -3    src/imageformats/pcx.cpp

https://invent.kde.org/frameworks/kimageformats/-/commit/bb66367bc82bd656150792da6eef1076f0cf69b5