fix: validate DIBv5 format before fallback to DIB in Windows clipboard#2861
fix: validate DIBv5 format before fallback to DIB in Windows clipboard#2861CarlosGtrz wants to merge 1 commit intoanomalyco:devfrom
Conversation
Previously, the clipboard reader would return errUnsupported when DIBv5 data existed but had an unsupported BitCount. This change validates the DIBv5 format (BitCount == 32) before processing, and falls back to readImageDib() for any DIBv5 validation failures or when DIBv5 data is unavailable, ensuring more reliable clipboard image reading.
|
I'm testing this out on a few different windows based terminals. Can I ask where specifically you find improvements in providing the DIB fallback? |
I found the problem when trying to paste a screenshot created using Snagit, a tool for taking and annotating screenshots. The DIB fallback is already there, but it fails when OC detects DIBv5 but can't decode the image (probably due to different bpp). With this change, OC detects DIBv5 and tries to read it. If it fails, it falls back to DIB. It worked great with Snagit. |
772b621 to
eb855e1
Compare
f1dc981 to
3e15a39
Compare
f8ee907 to
6a9856d
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Summary
Fixes Windows clipboard to properly fallback to DIB format when DIBv5 validation fails. Previously returned
errUnsupportedwhen DIBv5 had unsupported BitCount instead of trying DIB fallback.