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 images in a compressed format on Windows #2

Open
ArturKovacs opened this issue Sep 6, 2020 · 1 comment
Open

Copy images in a compressed format on Windows #2

ArturKovacs opened this issue Sep 6, 2020 · 1 comment

Comments

@ArturKovacs
Copy link
Collaborator

ArturKovacs commented Sep 6, 2020

Currently the Windows implementation uses the image crate to generate a bmp which may or may not be compressed depending on the underlying implementation of image.

Forcing compression with bmp or using a different format, like compressed png could be good alternatives. One thing to factor in is how wide-spread is the support for these formats as it wouldn't make much sense to generate both the compressed and the uncompressed format for compatibility sake (assuming that every program supports uncompressed bmp)

@DoumanAsh
Copy link
Contributor

Ok, I examined how Firefox copies image:

DataObject(size=Some(8)),text/html(size=Some(262)),HTML Format(size=Some(298)),text/_moz_htmlinfo(size=Some(8)),text/_moz_htmlcontext(size=Some(2)),application/x-moz-file-promise-url(size=Some(134)),application/x-moz-file-promise-dest-filename(size=Some(42)),CF_HDROP(size=Some(134)),Preferred DropEffect(size=Some(4)),application/x-moz-nativeimage(size=None),CF_DIBV5(size=Some(4268124)),CF_DIB(size=Some(4268040)),Ole Private Data(size=Some(648)),CF_BITMAP(size=None),

I thought they store it in custom format, but actually it is more generic than that.
If you see CF_BITMAP/CF_DIB on clipboard ten CF_HDROP is likely to contain ram image bytes that can be pasted as file in windows (via Crtl-V)
But you probably still need image encodrer as you want to set both CF_DIB and CF_HDROP

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