diff --git a/xcommon/Cargo.toml b/xcommon/Cargo.toml index 4d725d7d..713bc8e5 100644 --- a/xcommon/Cargo.toml +++ b/xcommon/Cargo.toml @@ -10,7 +10,7 @@ license = "Apache-2.0 OR MIT" anyhow = "1.0.68" byteorder = "1.4.3" dunce = "1" -image = { version = "0.24.5", default-features = false, features = ["png", "webp"] } +image = { version = "0.25.2", default-features = false, features = ["png", "webp"] } pem = "1.1.0" rasn = "0.6.1" rasn-pkix = "0.6.0" diff --git a/xcommon/src/lib.rs b/xcommon/src/lib.rs index 61e7c0af..a4fde16b 100644 --- a/xcommon/src/lib.rs +++ b/xcommon/src/lib.rs @@ -3,8 +3,7 @@ pub mod llvm; use anyhow::{Context, Result}; use byteorder::{LittleEndian, ReadBytesExt}; use image::imageops::FilterType; -use image::io::Reader as ImageReader; -use image::{DynamicImage, GenericImageView, ImageOutputFormat, RgbaImage}; +use image::{DynamicImage, GenericImageView, ImageFormat, ImageReader, RgbaImage}; use rsa::pkcs8::DecodePrivateKey; use rsa::{PaddingScheme, RsaPrivateKey, RsaPublicKey}; use sha2::{Digest, Sha256}; @@ -64,13 +63,13 @@ impl Scaler { .img .resize(opts.scaled_size, opts.scaled_size, FilterType::Nearest); if opts.scaled_size == opts.target_width && opts.scaled_size == opts.target_height { - resized.write_to(w, ImageOutputFormat::Png)?; + resized.write_to(w, ImageFormat::Png)?; } else { let x = (opts.target_width - opts.scaled_size) / 2; let y = (opts.target_height - opts.scaled_size) / 2; let mut padded = RgbaImage::new(opts.target_width, opts.target_height); image::imageops::overlay(&mut padded, &resized, x as i64, y as i64); - padded.write_to(w, ImageOutputFormat::Png)?; + padded.write_to(w, ImageFormat::Png)?; } Ok(()) }