fix(image): case-insensitive format matching in process_image

This commit is contained in:
xfy 2026-06-08 15:29:17 +08:00
parent 8b1b949bf8
commit 2c08c6c7fd

View File

@ -183,8 +183,8 @@ fn process_image(
} }
} }
// Output format // Output format (case-insensitive)
let output_format = match params.format.as_deref() { let output_format = match params.format.as_deref().map(str::to_lowercase).as_deref() {
Some("webp") => image::ImageFormat::WebP, Some("webp") => image::ImageFormat::WebP,
Some("png") => image::ImageFormat::Png, Some("png") => image::ImageFormat::Png,
Some("jpeg") | Some("jpg") => image::ImageFormat::Jpeg, Some("jpeg") | Some("jpg") => image::ImageFormat::Jpeg,