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

Unable to read image placed by Spectacle #104

Open
kmod-midori opened this issue May 8, 2023 · 0 comments
Open

Unable to read image placed by Spectacle #104

kmod-midori opened this issue May 8, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@kmod-midori
Copy link

Environment: Linux with X11, the application is being run as root because it also uses evdev.

For images copied from Chrome, everything works fine, but when I try to read a screenshot produced by Spectacle, this happens:

2023-05-08T12:26:31.282Z TRACE [arboard::platform::linux::x11] Started serve requests thread.
2023-05-08T12:26:31.282Z TRACE [arboard::platform::linux::x11] Trying to get the clipboard data.
2023-05-08T12:26:31.283Z TRACE [arboard::platform::linux::x11] Finished `convert_selection`
2023-05-08T12:26:31.283Z TRACE [arboard::platform::linux::x11] Read SelectionNotify
2023-05-08T12:26:31.283Z TRACE [arboard::platform::linux::x11] Clipboard server window is being destroyed x_x
get_clipboard_content() = Err(
    Unknown { .. } - "Unknown error while interacting with the clipboard: incorrect type received from clipboard",
)

Output of xclip -selection clipboard -t TARGETS -o

Chrome

TIMESTAMP
TARGETS
SAVE_TARGETS
MULTIPLE
image/png
text/html

Spectacle

application/x-qt-image
x-kde-force-image-copy
image/png
image/avif
image/bmp
image/bw
image/cur
image/eps
image/epsf
image/epsi
image/heic
image/heif
image/icns
image/ico
image/jp2
image/jpeg
image/jpg
image/jxl
image/pbm
BITMAP
image/pcx
image/pgm
image/pic
image/ppm
PIXMAP
image/rgb
image/rgba
image/sgi
image/tga
image/tif
image/tiff
image/wbmp
image/webp
image/xbm
image/xpm
TARGETS
MULTIPLE
TIMESTAMP
SAVE_TARGETS

As shown here, both cases do provide image/png, I wonder why this is not working, as the code in this library says that this should never happen.

BTW, since we already uses the image crate, why not provide a function that reads a PNG from the clipboard (this can be behind a feature flag, since we don't need to decode images on Windows)? We might be able to skip some decompression and compression for folks who actually need a PNG or other compressed format to work on.

@complexspaces complexspaces added the bug Something isn't working label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants