chore (backend-rs): address deprecation warning

This commit is contained in:
naskya 2024-07-22 06:10:45 +09:00
parent 72ab568a6a
commit 65ce0d5221
No known key found for this signature in database
GPG Key ID: 712D413B3A9FED5C

View File

@ -1,5 +1,5 @@
use crate::{database::cache, util::http_client};
use image::{io::Reader, ImageError, ImageFormat};
use image::{ImageReader, ImageError, ImageFormat};
use isahc::AsyncReadResponseExt;
use nom_exif::{parse_jpeg_exif, EntryValue, ExifTag};
use std::io::Cursor;
@ -87,7 +87,7 @@ pub async fn get_image_size_from_url(url: &str) -> Result<ImageSize, Error> {
let image_bytes = response.bytes().await?;
let reader = Reader::new(Cursor::new(&image_bytes)).with_guessed_format()?;
let reader = ImageReader::new(Cursor::new(&image_bytes)).with_guessed_format()?;
let format = reader.format();
if format.is_none() || !BROWSER_SAFE_IMAGE_TYPES.contains(&format.unwrap()) {