-
Notifications
You must be signed in to change notification settings - Fork 130
Rewrite Windows image attachments to use WIC instead of GDI+. #1254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
|
@swift-ci test |
|
@swift-ci test |
Sources/Overlays/_Testing_WinSDK/Support/Additions/IPropertyBag2Additions.swift
Outdated
Show resolved
Hide resolved
|
@swift-ci test |
|
I've asked @compnerd to review as well before I merge this PR. |
|
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)
|
@swift-ci test |
compnerd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a lot cleaner!
Sources/Overlays/_Testing_WinSDK/Attachments/_AttachableImageWrapper.swift
Show resolved
Hide resolved
|
|
||
| // Create the frame into which the bitmap will be composited. | ||
| var frame: UnsafeMutablePointer<IWICBitmapFrameEncode>? | ||
| var propertyBag: UnsafeMutablePointer<IPropertyBag2>? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties might be a better name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you feel strongly about it?
|
@swift-ci test |
|
@swift-ci test |
…ling HBITMAP reference
…leValue', conditionally expose an imageFormat property on Attachment
|
@swift-ci test |
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: