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.