noheic-convertion
Some checks failed
deploy / deploy (push) Failing after 5s

This commit is contained in:
2024-11-13 11:32:50 +03:00
parent 566379042d
commit b471c66209
5 changed files with 34 additions and 77 deletions

View File

@@ -8,7 +8,7 @@ use crate::s3_utils::{self, upload_to_s3, generate_key_with_extension};
use crate::lookup::store_file_info;
use futures::TryStreamExt;
use crate::handlers::MAX_WEEK_BYTES;
use crate::thumbnail::convert_heic_to_jpeg;
// use crate::thumbnail::convert_heic_to_jpeg;
/// Обработчик для аплоада файлов.
pub async fn upload_handler(
@@ -50,15 +50,10 @@ pub async fn upload_handler(
}
};
// Для HEIC файлов конвертируем в JPEG
// Для HEIC файлов просто сохраняем как есть
let (file_bytes, content_type) = if detected_mime_type == "image/heic" {
match convert_heic_to_jpeg(&file_bytes) {
Ok(jpeg_data) => (jpeg_data, "image/jpeg".to_string()),
Err(e) => {
warn!("Failed to convert HEIC to JPEG: {}", e);
(file_bytes, detected_mime_type)
}
}
warn!("HEIC support is temporarily disabled, saving original file");
(file_bytes, detected_mime_type)
} else {
(file_bytes, detected_mime_type)
};