[Bug 60057] New: gdiplus: GdipCloneBitmapArea drops trailing pixels for 1bpp/4bpp bitmaps with non-byte-aligned width
http://bugs.winehq.org/show_bug.cgi?id=60057 Bug ID: 60057 Summary: gdiplus: GdipCloneBitmapArea drops trailing pixels for 1bpp/4bpp bitmaps with non-byte-aligned width Product: Wine Version: 11.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdiplus Assignee: wine-bugs@list.winehq.org Reporter: illienar2002@gmail.com Target Milestone: --- Distribution: --- When cloning a bitmap whose pixel format is less than 8 bits per pixel and whose width is not a whole number of bytes, the rightmost pixels of every row are not copied. They retain the destination bitmap's initial zero value, which typically renders as black. This issue affects PixelFormat1bppIndexed (loses width%8 columns) & PixelFormat4bppIndexed (loses 1 column if width is odd). How to reproduce: 1.Create a PixelFormat1bppIndexed bitmap of width 10, any height, with all pixels set to a non-zero palette index; 2. Clone it using GdipCloneBitmapArea(); 3. Read back the pixels of the clone. The resulting bitmap will have lost data in the last two columns of the image. This is caused by image.c convert_pixels() same-format path algorithm rounding down when calculating byte width of a row: UINT widthbytes = PIXELFORMATBPP(src_format) * width / 8; which should be easily fixable with: UINT widthbytes = (PIXELFORMATBPP(src_format) * width + 7) / 8; -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60057 --- Comment #1 from Ken Sharp <imwellcushtymelike@gmail.com> --- Can you provide a test case? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60057 --- Comment #2 from Ilya Andrienko <illienar2002@gmail.com> --- (In reply to Ken Sharp from comment #1)
Can you provide a test case?
I have since gained access to forking the repository and made a PR with a new test and the fix, maybe that would clear things up: https://gitlab.winehq.org/wine/wine/-/merge_requests/11489 The test fails on master but runs ok with the fix. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60057 Ilya Andrienko <illienar2002@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Ilya Andrienko <illienar2002@gmail.com> --- Fixed in https://gitlab.winehq.org/wine/wine/-/merge_requests/11489 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60057 Dmitry Timoshkov <dmitry@baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |1fc89cc934e992543dbafd52ebf | |0f6833247295e -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla