diff options
author | 2023-09-04 12:58:41 +0200 | |
---|---|---|
committer | 2023-09-04 13:08:17 +0200 | |
commit | f468e25d0c67a01ee79d892f6e8ba9be019f06c7 (patch) | |
tree | c099dc3a7c4ef6faa5ce762832a286d0a55ec316 /src | |
parent | a56b25b9096d47ada3c4349f5b91110dfaa92bf6 (diff) | |
download | iced-f468e25d0c67a01ee79d892f6e8ba9be019f06c7.tar.gz iced-f468e25d0c67a01ee79d892f6e8ba9be019f06c7.tar.bz2 iced-f468e25d0c67a01ee79d892f6e8ba9be019f06c7.zip |
Use workspace dependencies and package inheritance
We are also taking this as a chance to synchronize
the versions of all the crates! Because of this, we
will skip the `0.11` version.
Diffstat (limited to 'src')
-rw-r--r-- | src/window/icon.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/window/icon.rs b/src/window/icon.rs index 0fe010ca..0cb206b3 100644 --- a/src/window/icon.rs +++ b/src/window/icon.rs @@ -13,7 +13,7 @@ use std::path::Path; /// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead. #[cfg(feature = "image")] pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> { - let icon = image_rs::io::Reader::open(icon_path)?.decode()?.to_rgba8(); + let icon = image::io::Reader::open(icon_path)?.decode()?.to_rgba8(); Ok(icon::from_rgba(icon.to_vec(), icon.width(), icon.height())?) } @@ -25,9 +25,10 @@ pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> { #[cfg(feature = "image")] pub fn from_file_data( data: &[u8], - explicit_format: Option<image_rs::ImageFormat>, + explicit_format: Option<image::ImageFormat>, ) -> Result<Icon, Error> { - let mut icon = image_rs::io::Reader::new(std::io::Cursor::new(data)); + let mut icon = image::io::Reader::new(std::io::Cursor::new(data)); + let icon_with_format = match explicit_format { Some(format) => { icon.set_format(format); @@ -59,5 +60,5 @@ pub enum Error { /// The `image` crate reported an error. #[cfg(feature = "image")] #[error("Unable to create icon from a file: {0}")] - ImageError(#[from] image_rs::error::ImageError), + ImageError(#[from] image::error::ImageError), } |