This commit is contained in:
2025-11-02 15:03:23 +01:00
parent 8f86a71c39
commit d6a6d1233c
10 changed files with 630 additions and 19 deletions
+4 -4
View File
@@ -274,7 +274,7 @@ impl JobHandler for GenerateThumbnailsJob {
.put_object(
&s3_key,
image.image_bytes.clone(),
Some("image/png".into()),
Some("image/webp".into()),
None,
)
.await
@@ -315,7 +315,7 @@ impl JobHandler for GenerateThumbnailsJob {
.put_object(
&s3_key,
image.image_bytes.clone(),
Some("image/png".into()),
Some("image/webp".into()),
None,
)
.await
@@ -609,7 +609,7 @@ fn encode_dynamic_image(image: image::DynamicImage) -> Result<GeneratedImage, St
let (width, height) = image.dimensions();
let mut cursor = Cursor::new(Vec::new());
image
.write_to(&mut cursor, ImageFormat::Png)
.write_to(&mut cursor, ImageFormat::WebP)
.map_err(|err| err.to_string())?;
Ok(GeneratedImage {
image_bytes: cursor.into_inner(),
@@ -660,7 +660,7 @@ fn persist_assets_metadata(
id: asset.asset_id,
document_version_id: context.version.id,
asset_type: asset.asset_type.to_string(),
mime_type: "image/png".to_string(),
mime_type: "image/webp".to_string(),
metadata: json!({
"generated_at": Utc::now().to_rfc3339(),
}),