-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Windows: Write an image encoded to PNG after being loaded as JPEG messes up the image #48
Comments
According to the doc of Write: Write writes a given buffer to the clipboard in a specified format. Write returned a receive-only channel can receive an empty struct as a signal, which indicates the clipboard has been overwritten from this write. If format t indicates an image, then the given buf assumes the image data is PNG encoded. |
Euh yes, I don't understand yet what I did wrong in my code. I decode a jpeg into an image.Image, then I re-encode it to PNG in a bytes.Buffer, and I write this buffer to the clipboard and to a file to compare. The written file is good, but clipboard's content is screwed. |
Which clipboard receiver are you using on Windows? Are you using the system built-in clipboard? (On Windows, use Shift+Win+s) I remember from Windows; it might be problematic because there is an implicit agreement between the content writer and content receiver. |
I just past clipboard content inside paint.exe. I think the implicit agrement is that the data is a PNG encoded data/file? |
I experience the same issue, no matter what image I use, and if it's png encoded or not, the final image which I paste from the clipboard is corrupt. if I write it to file instead, the image is normal png image. |
When executing this on windows, the PNG on disk is good, but the one on clipboard is bad
Source JPEG
Here is the resulting PNG in clipboard
The text was updated successfully, but these errors were encountered: