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

Mime type support #9

Closed
wiiznokes opened this issue Apr 9, 2024 · 4 comments
Closed

Mime type support #9

wiiznokes opened this issue Apr 9, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@wiiznokes
Copy link
Owner

wiiznokes commented Apr 9, 2024

Currently, a clipboard value can be copied differently based on his mime type. So we can't just expose all mimetype that was used by source applications. We need to support the most commun one.

  • text
  • image
  • links
  • ... ?

And see how this could be done.

For image, we need to check if the db is appropriate

@wiiznokes wiiznokes added the enhancement New feature or request label Apr 13, 2024
@wiiznokes
Copy link
Owner Author

wiiznokes commented Jul 16, 2024

image png nautilus

[/home/fedasus/Documents/wl-clipboard-rs/src/paste_watch.rs:348:17] &mime_types = {
    "text/uri-list",
    "x-special/gnome-copied-files",
    "application/vnd.portal.files",
    "application/vnd.portal.filetransfer",
    "text/plain;charset=utf-8",
}
2024-07-16T21:40:58.514217Z  INFO sending data to database: Data { creation: 1721166058514, mime: "text/plain;charset=utf-8", content: Ok(Text("/home/fedasus/Images/screenshot-2024-07-16-15-30-30.png")) }

@wiiznokes
Copy link
Owner Author

image from brave viewver

[/home/fedasus/Documents/wl-clipboard-rs/src/paste_watch.rs:348:17] &mime_types = {
    "image/png",
    "text/html",
}
2024-07-16T21:42:23.517293Z  INFO sending data to database: Data { creation: 1721166143517, mime: "text/html", content: Ok(Text("<img src=\"file:///run/user/1000/doc/2413d4d8/screenshot-2024-07-16-15-30-30.png\"/>")) } 

@wiiznokes
Copy link
Owner Author

plan:

  • watch all mime type
  • config with prefered image format
  • when an entry is detected, retreive an image in the prefered format if avaiable, if not, prefers common format implemented by the image crate, if not, just pick one and don't display it
  • if uri-list: do not copy data in the db. Just use the uri on the fs, with an image::Handle::from_path

@wiiznokes
Copy link
Owner Author

we can also request text/html in case of image to get alt info

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

No branches or pull requests

1 participant