Remove absolute module path leftovers in image::raster

This commit is contained in:
Héctor Ramón Jiménez 2021-09-30 16:12:28 +07:00
parent 21d138aa28
commit 60070eef27
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -44,7 +44,7 @@ impl Cache {
let memory = match handle.data() { let memory = match handle.data() {
image::Data::Path(path) => { image::Data::Path(path) => {
if let Ok(image) = ::image_rs::open(path) { if let Ok(image) = image_rs::open(path) {
let operation = std::fs::File::open(path) let operation = std::fs::File::open(path)
.ok() .ok()
.map(std::io::BufReader::new) .map(std::io::BufReader::new)
@ -59,7 +59,7 @@ impl Cache {
} }
} }
image::Data::Bytes(bytes) => { image::Data::Bytes(bytes) => {
if let Ok(image) = ::image_rs::load_from_memory(&bytes) { if let Ok(image) = image_rs::load_from_memory(&bytes) {
let operation = let operation =
Operation::from_exif(&mut std::io::Cursor::new(bytes)) Operation::from_exif(&mut std::io::Cursor::new(bytes))
.ok() .ok()
@ -75,7 +75,7 @@ impl Cache {
height, height,
pixels, pixels,
} => { } => {
if let Some(image) = ::image_rs::ImageBuffer::from_vec( if let Some(image) = image_rs::ImageBuffer::from_vec(
*width, *width,
*height, *height,
pixels.to_vec(), pixels.to_vec(),
@ -168,7 +168,7 @@ impl Operation {
let exif = exif::Reader::new().read_from_container(reader)?; let exif = exif::Reader::new().read_from_container(reader)?;
Ok(exif Ok(exif
.get_field(::exif::Tag::Orientation, ::exif::In::PRIMARY) .get_field(exif::Tag::Orientation, exif::In::PRIMARY)
.and_then(|field| field.value.get_uint(0)) .and_then(|field| field.value.get_uint(0))
.and_then(|value| u8::try_from(value).ok()) .and_then(|value| u8::try_from(value).ok())
.and_then(|value| Self::from_bits(value.saturating_sub(1))) .and_then(|value| Self::from_bits(value.saturating_sub(1)))