mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
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:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user