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

Convergence crate image #54

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Convergence crate image #54

merged 2 commits into from
Nov 19, 2024

Conversation

ChurchTao
Copy link
Owner

@ChurchTao ChurchTao commented Nov 19, 2024

@waywardmonkeys

#53

I understand what you mean. The reason I import all of them is that the clipboard does not only have png format images, for example, macOS also has TIFF, and Windows also has bmp or jpeg. And this is only when reading. When writing, I only want to write a jpeg format image. Users can use RustImage::from_bytes or RustImage::from_path to get the image object. So if I only import png, will it cause users to be unable to read the image?

@waywardmonkeys
Copy link
Contributor

Users who use the image crate on their own can add features to get additional formats.

so, if you h ave app_a which depends on both clipboard-rs and image, then if they enable the webp feature in image, that is additive. (Assuming Rust 2021 edition and workspaces using resolver = "2".)

If your code doesn't directly do anything with jpeg or TIFF, then you can rely on users who are doing whatever to handle it, I think.

@ChurchTao
Copy link
Owner Author

There is.

let tiff_data = unsafe { image.TIFFRepresentation() };

fn to_jpeg(&self) -> Result<RustImageBuffer>;

@waywardmonkeys
Copy link
Contributor

This PR seems correct then!

@ChurchTao ChurchTao merged commit 460ec38 into master Nov 19, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants