chore(cargo): update image crate to 0.25.2

This version deprecated `image::io::Reader`,
requires changes to avoid warnings.
This commit is contained in:
link2xt
2024-07-22 16:58:15 +00:00
parent c596ee0256
commit 837311abce
3 changed files with 11 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ use anyhow::{format_err, Context as _, Result};
use base64::Engine as _;
use futures::StreamExt;
use image::codecs::jpeg::JpegEncoder;
use image::io::Reader as ImageReader;
use image::ImageReader;
use image::{DynamicImage, GenericImage, GenericImageView, ImageFormat, Pixel, Rgba};
use num_traits::FromPrimitive;
use tokio::io::AsyncWriteExt;

View File

@@ -305,7 +305,7 @@ pub fn get_filesuffix_lc(path_filename: &str) -> Option<String> {
/// Returns the `(width, height)` of the given image buffer.
pub fn get_filemeta(buf: &[u8]) -> Result<(u32, u32)> {
let image = image::io::Reader::new(Cursor::new(buf)).with_guessed_format()?;
let image = image::ImageReader::new(Cursor::new(buf)).with_guessed_format()?;
let dimensions = image.into_dimensions()?;
Ok(dimensions)
}