-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Incorrect image obtained from clipboard.get("png") #6366
Comments
I can't reproduce the jpeg case. Please give more information on this, e.g. the sample image. |
@Blatman thanks. but it works for me. How did you put it into clipboard? I opened this issue page with Safari, right click on the image and click 'copy image'. |
@Blatman did you mean you are using a jpeg image or you are using 'jpeg' format parameter in the source code in index.html? |
To clarify, when I said
I meant it worked when using the "jpeg" paramenter when making a call to clipboard.get in the source code. |
Whoops - sorry my mistake - code is set up expecting png and I used the jpg so it will fail - sorry for wasting time. |
@Blatman no problem and good to know it :) and thanks for help testing NW. |
btw, the source format shouldn't matter, it will be converted to the format requested. |
This is fixed in git and will be available in the next nightly build. |
NWJS Version : v0.27.3 SDK
Operating System : Windows 10
Expected behavior
To be able to create the correct image from the data obtained from calling clipboard.get("png")
Actual behavior
The image created is only correct in size, the content is all messed up.
How to reproduce
Make sure there is an image in the system clipboard.
In the javascript of an app get the clipboard object with nw.Clipboard.get()
Get the image data with clipboard.get("png")
Use the result of the previous call to populate an Image object
When that is complete, append the image to the body of the document. The drawn image is wrong.
Note: This works fine when requesting a "jpeg" from the clipboard.
Here is a basic app demonstrating the problem example-app.zip. Just make sure there is an image in the clipboard and hit the PASTE button.
The text was updated successfully, but these errors were encountered: