Skip to content
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

Copy image to clipboard compatibility issues #317

Closed
God-damnit-all opened this issue Jun 14, 2021 · 11 comments
Closed

Copy image to clipboard compatibility issues #317

God-damnit-all opened this issue Jun 14, 2021 · 11 comments

Comments

@God-damnit-all
Copy link

I've noticed that when using the Ctrl+C copy image to clipboard feature in qimgv, some things will accept it being pasted while others that should, won't. I end up having to use Honeyview to copy the image to clipboard instead, and then it works on everything I expect it to work on.

I've been wanting to wait until I had something more substantive than this, but I'm honestly not sure how I can compare the differences between qimgv's copy image to clipboard and Honeyview's. Do you know of any way to do this so I can describe this issue in greater detail? Or I suppose the alternative is you can try Honeyview and compare for yourself.

@God-damnit-all
Copy link
Author

God-damnit-all commented Jun 14, 2021

I think I might have accidentally stumbled into the problem when using AutoHotkey to try and compare the Clipboard data. qimgv seems to copy both the image's path and the image data to the clipboard. Honeyview only copies the image data to the clipboard.

If possible, could you include an advanced option to turn this off? Or maybe upload a debug build for me that disables it so I can confirm that is what's causing problems?

@easymodo
Copy link
Owner

i'll try honeyview later today

some things will accept it being pasted while others that should, won't

could you tell me which app did not accept the pasted contents?

@God-damnit-all
Copy link
Author

God-damnit-all commented Jun 16, 2021

The two apps I notice this happening with the most are Discord Canary and Hyper-V's Virtual Machine Connect (with Enhanced Session for clipboard sharing). For some reason, Discord Stable and Discord PTB do not have the same problem - months ago, I thought it might have been a temporary bug in the Canary branch, but it's been going on for too long for that to be the case. There must be fundamental differences in Canary for the purposes of developing and testing.

I found a tool that allows for quick and convenient clipboard testing and comparison, nircmd. Here are the test files: test.zip The clp files were saved with nircmd's nircmd clipboard saveclp <PATH> command, and can be loaded up with the nircmd clipboard loadclp <PATH> command, as can be seen from the documentation here. The files ending with _nircmd.clp is saved clipboard data from using the nircmd clipboard copyimage <PATH> command.

One thing to point out is the clipboard data from qimgv is much, much larger than the clipboard data from the other two programs. I first suspected that it was because qimgv was copying the alpha data of each pixel even if the image had no alpha layer to speak of, but only nircmd was able to preserve the transparency when pasting to any version of Discord or even through Hyper-V's enhanced session. Honeyview discards the alpha data completely in favor of whatever background color is assigned to transparent images in the settings.

Though, one quirk with nircmd's clipboard is that, when pasting to a program that isn't equipped to receive alpha data, the background is black with these RGB pixels on the border:
image

In any case, it seems like nircmd's implementation of copying images to clipboards is ideal, except it would be useful to have some sort of setting to control how transparency is handled.

@easymodo
Copy link
Owner

sorry for taking so long
fixed.

@easymodo
Copy link
Owner

easymodo commented Jul 16, 2021

@God-damnit-all
Copy link
Author

https://www.dropbox.com/s/skt7nwro5ejdfxs/qimgv-0.9.2-alpha2-58-26e42dc.7z?dl=1
try it just to be sure

Seems to have broken the function entirely, now I can't paste the image data into anything. Here's the new output of nircmd clipboard saveclp

It's significantly smaller than the other ones, too:
image

@easymodo
Copy link
Owner

Weird. Looks like discord does not accept anything from clipboard except image/png
https://support.discord.com/hc/en-us/community/posts/360043164391-Allow-pasting-of-mime-types-other-than-image-png
So if i force convert everything to png like honeyview then it works with discord but it'll fuck up other things like pasting into filemanager (which honeyview cant even do..?)
This leaves only adding a workaround option in settings unfortunately

Drag'n'drop works fine btw

now I can't paste the image data into anything

Not just discord? it works for me (gimp, paint.net, telegram etc.). New one pastes even faster

@easymodo easymodo reopened this Jul 17, 2021
easymodo added a commit that referenced this issue Jul 17, 2021
@easymodo
Copy link
Owner

https://www.dropbox.com/s/ljep24yisqkwr8s/qimgv-0.9.2-alpha2-59-be00545.7z?dl=1

works with everything i've tried. discord canary included (with option on)

screenshot 3631

@God-damnit-all
Copy link
Author

https://www.dropbox.com/s/ljep24yisqkwr8s/qimgv-0.9.2-alpha2-59-be00545.7z?dl=1

works with everything i've tried. discord canary included (with option on)

screenshot 3631

Heh, now it works in Discord Canary but not PTB or Stable. Not sure what's up with that.

easymodo added a commit that referenced this issue Jul 17, 2021
@easymodo
Copy link
Owner

ok reverting this, dont care, not my fault, discord bad
use stable or just do a drag'n'drop instead of copy

@God-damnit-all
Copy link
Author

God-damnit-all commented Jul 17, 2021

ok reverting this, dont care, not my fault, discord bad
use stable or just do a drag'n'drop instead of copy

I mean, Honeyview's clipboard copy works with both, but alright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants