Menu

#650 TDib does not handle correctly some bitmaps

6.44
pending
GUI (79)
1
4 days ago
2026-08-31
No

According to the documentation of BITMAPINFOHEADER, for uncompressed RGB bitmaps the member biSizeImage can be set to 0. But TDib does not handle correctly such bitmaps when they are loaded from a resource. Subsequently, when trying to use such bitmap in a toolbar, only garbage is dsiaplyed.

The problem may be in the ResToMemHandle method, where the bitmap is copied, and the memory size is calculated using that member - and if it is 0, then the bitmap may not be copied correctly.

Related

Feature Requests: #213
Wiki: OWLNext_Stable_Releases

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2026-08-31

    This issue has been fixed on the trunk [r8858] (reverted and redone in [r8862]), and the fix has been merged into Owlet [r8859].

     

    Related

    Commit: [r8858]
    Commit: [r8859]
    Commit: [r8862]


    Last edit: Vidar Hasfjord 2026-09-01
  • Vidar Hasfjord

    Vidar Hasfjord - 2026-08-31

    I just recalled [bugs:#338] "TDib fails for top-down DIBs".

    See [discussion:3b9d1452].

    Now that the TDib implementation has been looked into and debugged, perhaps there is opportunity for an easy fix for the top-down issue as well. It may be as easy as applying a std::abs call in the right place. If so, @jarnol may finally be able to remove his workaround and apply a simple patch instead.

     

    Related

    Bugs: #338
    Discussion: 3b9d1452

    • Ognyan Chernokozhev

      Yes, this is something to look at as well.

      May need to find a way to create some top-down bitmaps to test.

       
      👍
      1
  • Ognyan Chernokozhev

    • status: open --> pending
     

Log in to post a comment.