Rewrite Windows image attachments to use WIC instead of GDI+.#1254
Merged
Conversation
This PR shifts our support for Windows image attachments onto WIC (Windows Imaging Component) instead of GDI+, which is an older API that supports fewer types of image object.
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test |
stmontgomery
reviewed
Aug 7, 2025
stmontgomery
reviewed
Aug 7, 2025
stmontgomery
approved these changes
Aug 7, 2025
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
I've asked @compnerd to review as well before I merge this PR. |
Contributor
Author
|
Note to self: copy HBITMAP/HICON instead of risking UAF—use https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-copyimage |
…fe consumption pattern)
Contributor
Author
|
@swift-ci test |
compnerd
approved these changes
Aug 8, 2025
|
|
||
| // Create the frame into which the bitmap will be composited. | ||
| var frame: UnsafeMutablePointer<IWICBitmapFrameEncode>? | ||
| var propertyBag: UnsafeMutablePointer<IPropertyBag2>? |
Member
There was a problem hiding this comment.
properties might be a better name.
Contributor
Author
There was a problem hiding this comment.
Do you feel strongly about it?
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test |
…ling HBITMAP reference
…leValue', conditionally expose an imageFormat property on Attachment
Contributor
Author
|
@swift-ci test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR shifts our support for Windows image attachments onto WIC (Windows Imaging Component) instead of GDI+, which is an older API that supports fewer types of image object.
This change also removes the dependency on C++ interop from the WinSDK overlay module, which could have prevented it from being used by modules that don't have C++ interop enabled.
Yes,
obj.pointee.lpVtbl.pointee.Release(obj)is how you spell it.Checklist: