mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
4a78effa88
commit
1256dffcd3
4
utils.py
4
utils.py
|
@ -381,7 +381,7 @@ def get_image_mime_type(image_filename: str) -> str:
|
||||||
def getImageExtensionFromMimeType(contentType: str) -> str:
|
def getImageExtensionFromMimeType(contentType: str) -> str:
|
||||||
"""Returns the image extension from a mime type, such as image/jpeg
|
"""Returns the image extension from a mime type, such as image/jpeg
|
||||||
"""
|
"""
|
||||||
imageMedia = {
|
image_media = {
|
||||||
'png': 'png',
|
'png': 'png',
|
||||||
'jpeg': 'jpg',
|
'jpeg': 'jpg',
|
||||||
'gif': 'gif',
|
'gif': 'gif',
|
||||||
|
@ -390,7 +390,7 @@ def getImageExtensionFromMimeType(contentType: str) -> str:
|
||||||
'avif': 'avif',
|
'avif': 'avif',
|
||||||
'x-icon': 'ico'
|
'x-icon': 'ico'
|
||||||
}
|
}
|
||||||
for mimeExt, ext in imageMedia.items():
|
for mimeExt, ext in image_media.items():
|
||||||
if contentType.endswith(mimeExt):
|
if contentType.endswith(mimeExt):
|
||||||
return ext
|
return ext
|
||||||
return 'png'
|
return 'png'
|
||||||
|
|
Loading…
Reference in New Issue