diff --git a/backend/app/admin/service/file_service.py b/backend/app/admin/service/file_service.py index 158daef..34a79fd 100755 --- a/backend/app/admin/service/file_service.py +++ b/backend/app/admin/service/file_service.py @@ -768,10 +768,10 @@ class FileService: content_length = int(content_length) if content_length is not None else (size or 0) except: content_length = size or 0 - content_type = head.get('Content-Type') or head.get('ContentType') or mime + content_type = mime or head.get('Content-Type') or head.get('ContentType') etag = (head.get('ETag') or '').strip('"') file_hash_val = sha256 or etag or hashlib.sha256(f"cos:{cloud_path}:{file_id_in_cos}".encode()).hexdigest() - is_image = (content_type or '').lower().startswith('image/') or (mime or '').lower().startswith('image/') + is_image = (mime or '').lower().startswith('image/') or (content_type or '').lower().startswith('image/') if is_image: avif_key = f"{file_id}_avif" pic_ops = {