no, jpeg IS a format
This commit is contained in:
@@ -44,7 +44,7 @@ audio_type_set : AudioTypeSet =\
|
|||||||
image_type_set : ImageTypeSet =\
|
image_type_set : ImageTypeSet =\
|
||||||
{
|
{
|
||||||
'bmp': 'image/bmp',
|
'bmp': 'image/bmp',
|
||||||
'jpg': 'image/jpeg',
|
'jpeg': 'image/jpeg',
|
||||||
'png': 'image/png',
|
'png': 'image/png',
|
||||||
'webp': 'image/webp'
|
'webp': 'image/webp'
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,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', 'jpg', 'png' ]
|
temp_frame_formats : List[ImageFormat] = [ 'bmp', 'jpeg', 'png' ]
|
||||||
|
|
||||||
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' ]
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ def get_file_format(file_path : str) -> Optional[str]:
|
|||||||
file_extension = get_file_extension(file_path)
|
file_extension = get_file_extension(file_path)
|
||||||
|
|
||||||
if file_extension:
|
if file_extension:
|
||||||
if file_extension == '.jpeg':
|
if file_extension == '.jpg':
|
||||||
return 'jpg'
|
return 'jpeg'
|
||||||
return file_extension.lower().lstrip('.')
|
return file_extension.lower().lstrip('.')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -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', 'jpg', 'png', 'webp']
|
ImageFormat = Literal['bmp', 'jpeg', 'png', 'webp']
|
||||||
VideoFormat = Literal['avi', 'mkv', 'mov', 'mp4', 'webm']
|
VideoFormat = Literal['avi', 'mkv', 'mov', 'mp4', 'webm']
|
||||||
TempFrameFormat = Literal['bmp', 'jpg', 'png']
|
TempFrameFormat = Literal['bmp', 'jpeg', 'png']
|
||||||
AudioTypeSet = Dict[AudioFormat, str]
|
AudioTypeSet = Dict[AudioFormat, str]
|
||||||
ImageTypeSet = Dict[ImageFormat, str]
|
ImageTypeSet = Dict[ImageFormat, str]
|
||||||
VideoTypeSet = Dict[VideoFormat, str]
|
VideoTypeSet = Dict[VideoFormat, str]
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ def test_get_file_extension() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_get_file_format() -> None:
|
def test_get_file_format() -> None:
|
||||||
assert get_file_format('source.jpg') == 'jpg'
|
assert get_file_format('source.jpg') == 'jpeg'
|
||||||
assert get_file_format('source.jpeg') == 'jpg'
|
assert get_file_format('source.jpeg') == 'jpeg'
|
||||||
assert get_file_format('source.mp3') == 'mp3'
|
assert get_file_format('source.mp3') == 'mp3'
|
||||||
assert get_file_format('invalid') is None
|
assert get_file_format('invalid') is None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user