Add tiff image format

This commit is contained in:
henryruhs
2025-01-15 15:41:54 +01:00
parent faf5020051
commit e5278996d1
3 changed files with 6 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ image_type_set : ImageTypeSet =\
'bmp': 'image/bmp', 'bmp': 'image/bmp',
'jpeg': 'image/jpeg', 'jpeg': 'image/jpeg',
'png': 'image/png', 'png': 'image/png',
'tiff': 'image/tiff',
'webp': 'image/webp' 'webp': 'image/webp'
} }
video_type_set : VideoTypeSet =\ video_type_set : VideoTypeSet =\
@@ -59,7 +60,7 @@ video_type_set : VideoTypeSet =\
audio_formats : List[AudioFormat] = list(audio_type_set.keys()) audio_formats : List[AudioFormat] = list(audio_type_set.keys())
image_formats : List[ImageFormat] = list(image_type_set.keys()) image_formats : List[ImageFormat] = list(image_type_set.keys())
video_formats : List[VideoFormat] = list(video_type_set.keys()) video_formats : List[VideoFormat] = list(video_type_set.keys())
temp_frame_formats : List[ImageFormat] = [ 'bmp', 'jpeg', 'png' ] temp_frame_formats : List[ImageFormat] = [ 'bmp', 'jpeg', 'png', 'tiff' ]
output_audio_encoders : List[AudioEncoder] = [ 'aac', 'libmp3lame', 'libopus', 'libvorbis' ] output_audio_encoders : List[AudioEncoder] = [ 'aac', 'libmp3lame', 'libopus', 'libvorbis' ]
output_video_encoders : List[VideoEncoder] = [ 'libx264', 'libx265', 'libvpx-vp9', 'h264_nvenc', 'hevc_nvenc', 'h264_amf', 'hevc_amf', 'h264_qsv', 'hevc_qsv', 'h264_videotoolbox', 'hevc_videotoolbox' ] output_video_encoders : List[VideoEncoder] = [ 'libx264', 'libx265', 'libvpx-vp9', 'h264_nvenc', 'hevc_nvenc', 'h264_amf', 'hevc_amf', 'h264_qsv', 'hevc_qsv', 'h264_videotoolbox', 'hevc_videotoolbox' ]

View File

@@ -34,6 +34,8 @@ def get_file_format(file_path : str) -> Optional[str]:
if file_extension: if file_extension:
if file_extension == '.jpg': if file_extension == '.jpg':
return 'jpeg' return 'jpeg'
if file_extension == 'tif':
return 'tiff'
return file_extension.lower().lstrip('.') return file_extension.lower().lstrip('.')
return None return None

View File

@@ -110,9 +110,9 @@ FaceMaskRegion = Literal['skin', 'left-eyebrow', 'right-eyebrow', 'left-eye', 'r
FaceMaskRegionSet = Dict[FaceMaskRegion, int] FaceMaskRegionSet = Dict[FaceMaskRegion, int]
AudioFormat = Literal['mp3', 'ogg', 'wav'] AudioFormat = Literal['mp3', 'ogg', 'wav']
ImageFormat = Literal['bmp', 'jpeg', 'png', 'webp'] ImageFormat = Literal['bmp', 'jpeg', 'png', 'tiff', 'webp']
VideoFormat = Literal['avi', 'mkv', 'mov', 'mp4', 'webm'] VideoFormat = Literal['avi', 'mkv', 'mov', 'mp4', 'webm']
TempFrameFormat = Literal['bmp', 'jpeg', 'png'] TempFrameFormat = Literal['bmp', 'jpeg', 'png', 'tiff']
AudioTypeSet = Dict[AudioFormat, str] AudioTypeSet = Dict[AudioFormat, str]
ImageTypeSet = Dict[ImageFormat, str] ImageTypeSet = Dict[ImageFormat, str]
VideoTypeSet = Dict[VideoFormat, str] VideoTypeSet = Dict[VideoFormat, str]