Use an opaque Id type for image::Handle

Hashing pointers is a terrible idea.
This commit is contained in:
Héctor Ramón Jiménez 2024-05-01 01:39:43 +02:00
parent f5bc336d69
commit b52c7bb610
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
6 changed files with 59 additions and 36 deletions

View file

@ -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()),
};