This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user