Version updates (#3626)

* Update some Labrinth dependencies

* Update some Labrinth dependencies

* Update some Labrinth dependencies

* Update zip in Labrinth

* Update itertools in Labrinth

* Update validator in labrinth

* Update thiserror in labrinth

* Update rust_decimal, redis, and deadpool-redis in labrinth

* Update totp-rs and spdx in labrinth

* Update maxminddb and tar in labrinth

* Update sentry and sentry-actix in labrinth

* Update image in labrinth

* Update lettre in labrinth

* Update derive-new and rust_iso3166 in labrinth

* Update async-stripe and json-patch in labrinth

* Update clap and iana-time-zone in labrinth

* Update labrinth to Rust 2024

* Cargo fmt

* Just do a full cargo update

* Update daedelus to Rust 2024

* Update daedelus_client to Rust 2024

* Set the formatting edition to 2024

* Fix formatting

IntelliJ messed up my formatting
This commit is contained in:
Josiah Glosson
2025-05-09 07:27:55 -05:00
committed by GitHub
parent 6e46317a37
commit 62de07e4e6
146 changed files with 1942 additions and 2311 deletions

View File

@@ -5,11 +5,12 @@ use crate::file_hosting::FileHost;
use crate::models::images::ImageContext;
use crate::routes::ApiError;
use color_thief::ColorFormat;
use hex::ToHex;
use image::imageops::FilterType;
use image::{
DynamicImage, EncodableLayout, GenericImageView, ImageError,
ImageOutputFormat,
DynamicImage, EncodableLayout, GenericImageView, ImageError, ImageFormat,
};
use sha1::Digest;
use std::io::Cursor;
use webp::Encoder;
@@ -57,7 +58,7 @@ pub async fn upload_image_optimized(
let cdn_url = dotenvy::var("CDN_URL")?;
let hash = sha1::Sha1::from(&bytes).hexdigest();
let hash = sha1::Sha1::digest(&bytes).encode_hex::<String>();
let (processed_image, processed_image_ext) = process_image(
bytes.clone(),
content_type,
@@ -150,7 +151,7 @@ fn process_image(
// Optimize and compress
let mut output = Vec::new();
img.write_to(&mut Cursor::new(&mut output), ImageOutputFormat::WebP)?;
img.write_to(&mut Cursor::new(&mut output), ImageFormat::WebP)?;
Ok((bytes::Bytes::from(output), "webp".to_string()))
}