summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-01 01:39:43 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-01 01:39:43 +0200
commitb52c7bb610f593fffc624d461dca17ac50c81626 (patch)
tree19e1ac3268350b422154c6fd1cd3a585e250d3ac /graphics
parentf5bc336d699d0c6440f6d638a5a437baaabe1e43 (diff)
downloadiced-b52c7bb610f593fffc624d461dca17ac50c81626.tar.gz
iced-b52c7bb610f593fffc624d461dca17ac50c81626.tar.bz2
iced-b52c7bb610f593fffc624d461dca17ac50c81626.zip
Use an opaque `Id` type for `image::Handle`
Hashing pointers is a terrible idea.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/image.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/graphics/src/image.rs b/graphics/src/image.rs
index 2a630530..04c45057 100644
--- a/graphics/src/image.rs
+++ b/graphics/src/image.rs
@@ -102,7 +102,7 @@ pub fn load(
}
let (width, height, pixels) = match handle {
- image::Handle::Path(path) => {
+ image::Handle::Path(_, path) => {
let image = ::image::open(path)?;
let operation = std::fs::File::open(path)
@@ -119,7 +119,7 @@ pub fn load(
image::Bytes::from(rgba.into_raw()),
)
}
- image::Handle::Bytes(bytes) => {
+ image::Handle::Bytes(_, bytes) => {
let image = ::image::load_from_memory(bytes)?;
let operation =
Operation::from_exif(&mut std::io::Cursor::new(bytes))
@@ -138,6 +138,7 @@ pub fn load(
width,
height,
pixels,
+ ..
} => (*width, *height, pixels.clone()),
};