-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix the fetching of images in CF_DIB
format in DisplayServerWindows::clipboard_get_image
#88220
Fix the fetching of images in CF_DIB
format in DisplayServerWindows::clipboard_get_image
#88220
Conversation
Your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
CF_DIB
format in DisplayServerWindows::clipboard_get_image
0d9d5f8
to
3b18d71
Compare
Thank you for your help. I tried to amend my commit to fix this. Is it correct now ? Must I completely redo the commit ? |
Seems good now, it's got two authors though, unsure if it matters, could do |
3b18d71
to
4e990cd
Compare
…clipboard_get_image Fix the fetching of images from windows clipboard, if they're in CF_DIB format (e. g. by taking screenshots). Image::create_from_data was used with an instance of Image, but it's a static function, returning a new instance.
The amend was creating a new commit and a merge commit... Unfortunalty to avoid that, I did something bad by force pushing. Sorry for that... (I'll make sure to be cautious next time) |
It looks good now! |
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.2.2. |
A bug was occuring when trying to import an image from the windows clipbpoard, if it's in CF_DIB format (e. g. by taking screenshots). No image was returned.
It comes from a tiny error : in
DisplayServerWindows::clipboard_get_image
,Image::create_from_data
was used with an instance ofImage
, but since it's a static function, it returns a new instance instead of modifying the 'called' one.Correcting this fixes the importation.
Testing with a GDScript
This script was attached to a TextureRect node in the testing scene.
(At the start, the clipboard must contains an image in CF_DIB format, for instance a screenshot, or some images coming from a web navigator, in the right format, copied with the right-click context menu.)
PS : I apologies if my PR isn't conform to godot contributor's workflow, or for any other problem.