You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When copying an image to the clipboard using CF_DIB, the size of the data should be the same both before AND after copying the image. However, the size of the copied image is 1 byte larger.
Steps to reproduce the problem.
Download the image.png file (or just any image file named image.png) and run the following Python script in the same
directory:
importwin32clipboardwithopen('image.png', 'rb') asimage:
image_bytes=image.read()
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(win32clipboard.CF_DIB, image_bytes)
copied_bytes=win32clipboard.GetClipboardData(win32clipboard.CF_DIB)
win32clipboard.CloseClipboard()
print('Original image size:', len(image_bytes)) # 37257 bytes using attached fileprint('Copied data size:', len(copied_bytes)) # 37258 bytes using attached file
Version of Python and pywin32
Python: 3.11.4
pywin32: 306
The text was updated successfully, but these errors were encountered:
Expected behavior and actual behavior.
When copying an image to the clipboard using
CF_DIB
, the size of the data should be the same both before AND after copying the image. However, the size of the copied image is 1 byte larger.Steps to reproduce the problem.
Download the image.png file (or just any image file named
image.png
) and run the following Python script in the samedirectory:
Version of Python and pywin32
Python: 3.11.4
pywin32: 306
The text was updated successfully, but these errors were encountered: