https://bugs.winehq.org/show_bug.cgi?id=38622
Bug ID: 38622 Summary: PixelFormat32bppARGB != PixelFormat8bppIndexed Product: Wine Version: 1.6.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mathieu.malaterre@gmail.com Distribution: ---
Created attachment 51527 --> https://bugs.winehq.org/attachment.cgi?id=51527 source code
For some reason GDI+ on windows returns PixelFormat32bppARGB instead of PixelFormat8bppIndexed for a grayscale PNG file (JPEG & TIFF seems consistant though).
It would be nice if behavior would be consistant across implementation.
Compile and run attachements.
From Linux:
$ ./gdidump.exe input.png fixme:wincodecs:PngDecoder_Block_GetCount 0x142e30,0x61f708: stub Width x Height: 512 512 PixelFormat8bppIndexed found !
From Windows:
gdidump.exe input.png
Width x Height: 512 512 PixelFormat32bppARGB found !
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #1 from Mathieu Malaterre mathieu.malaterre@gmail.com --- Created attachment 51528 --> https://bugs.winehq.org/attachment.cgi?id=51528 input.png image
https://bugs.winehq.org/show_bug.cgi?id=38622
Mathieu Malaterre mathieu.malaterre@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mathieu.malaterre@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #2 from Mathieu Malaterre mathieu.malaterre@gmail.com --- Well technically the windows implementation is seriously bogus here. Feel free to close as invalid, your implementation is actually superior !
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #3 from Ken Thomases ken@codeweavers.com --- Curious. OS X's CGImageSource API does a similar thing. It was actually considered an obstacle to using it as a back-end for windowscodecs.
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #4 from Mathieu Malaterre mathieu.malaterre@gmail.com --- I've filed a bug upstream also:
http://connect.microsoft.com/VisualStudio/feedback/details/1355778/pixelform...
But really there is nothing wrong with this approach, this is legal for GDI+ to load a single component grayscale PNG file as an ARGB. So I'd like to remove my comment #2.
Would it be possible to have a consistant behavior in wine instead ? Thanks
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #5 from Mathieu Malaterre mathieu.malaterre@gmail.com --- After digging in the code here is what I found out (http://stackoverflow.com/a/30396519/136285):
For Grayscale PNG:
PixelFormat is: PixelFormat32bppARGB ImageFlagsColorSpaceRGB is not set
For RGB PNG:
PixelFormat is: PixelFormat24bppRGB ImageFlagsColorSpaceRGB is set
For RGBA PNG:
PixelFormat is: PixelFormat32bppARGB ImageFlagsColorSpaceRGB is set
https://bugs.winehq.org/show_bug.cgi?id=38622
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michael@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #6 from Dmitry Timoshkov dmitry@baikal.ru --- Please retest with recent (preferably latest git) version of Wine.
https://bugs.winehq.org/show_bug.cgi?id=38622
--- Comment #7 from Mathieu Malaterre mathieu.malaterre@gmail.com --- Same exact behavior from 1.7.43
https://bugs.winehq.org/show_bug.cgi?id=38622
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|PixelFormat32bppARGB != |gdiplus should return |PixelFormat8bppIndexed |PixelFormat32bppARGB | |instead of | |PixelFormat8bppIndexed for | |a grayscale PNG file
--- Comment #8 from Dmitry Timoshkov dmitry@baikal.ru --- This needs to be tested on both WIC and gdiplus sides.
https://bugs.winehq.org/show_bug.cgi?id=38622
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |STAGED CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, sebastian@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/gdiplus-Graysc | |ale_PNG
https://bugs.winehq.org/show_bug.cgi?id=38622
David Korth gerbilsoft@gerbilsoft.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gerbilsoft@gerbilsoft.com
--- Comment #9 from David Korth gerbilsoft@gerbilsoft.com --- Created attachment 55621 --> https://bugs.winehq.org/attachment.cgi?id=55621 Sample grayscale PNG image.
I've been getting slightly different behavior on wine-1.9.16 (and wine-1.9.18). I have a grayscale PNG image, and wine's gdiplus is actually converting it to ARGB32, like the Windows GDI+ does; however, it's also reporting image flags of 0x13042. This indicates the image is grayscale (0x40), and it has an alpha channel (0x02). The alpha value is bogus; on Windows XP, it returns 0x40.
I attached a sample image that I'm using in a test suite with GDI+ as a backend on Windows.
https://bugs.winehq.org/show_bug.cgi?id=38622
David Korth gerbilsoft@gerbilsoft.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #55621|0 |1 is obsolete| |
--- Comment #10 from David Korth gerbilsoft@gerbilsoft.com --- Created attachment 55622 --> https://bugs.winehq.org/attachment.cgi?id=55622 Sample grayscale PNG image.
I uploaded the wrong image; that one actually has an alpha channel.
This one does not, and is the one that GDI+ was incorrectly reporting as having alpha.
https://bugs.winehq.org/show_bug.cgi?id=38622
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |gdiplus
https://bugs.winehq.org/show_bug.cgi?id=38622
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |NEW
--- Comment #11 from Sebastian Lackner sebastian@fds-team.de --- This should be fixed with 8c593bd37ad1177144d720d17b6b706d2ee619f1 and previous commits, please retest.
https://bugs.winehq.org/show_bug.cgi?id=38622
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |8c593bd37ad1177144d720d17b6 | |b706d2ee619f1 Status|NEW |RESOLVED
--- Comment #12 from Nikolay Sivov bunglehead@gmail.com --- Marking fixed, test program output matches Windows now.
https://bugs.winehq.org/show_bug.cgi?id=38622
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.17.