mirror of
https://github.com/Huluti/Curtail.git
synced 2024-08-16 09:30:28 +03:00
Fix #189
This commit is contained in:
parent
89f98cf92a
commit
0d1c98837d
21
src/tools.py
21
src/tools.py
@ -62,18 +62,15 @@ def add_filechooser_filters(dialog):
|
||||
|
||||
|
||||
def get_file_type(filename):
|
||||
content_type, uncertain = Gio.content_type_guess(filename=str(filename))
|
||||
if not uncertain:
|
||||
if content_type == 'image/jpeg':
|
||||
return 'jpg'
|
||||
elif content_type == 'image/png':
|
||||
return 'png'
|
||||
elif content_type == 'image/webp':
|
||||
return 'webp'
|
||||
elif content_type == 'image/svg+xml':
|
||||
return 'svg'
|
||||
else:
|
||||
return None
|
||||
content_type = Gio.content_type_guess(filename=str(filename))[0]
|
||||
if content_type == 'image/jpeg':
|
||||
return 'jpg'
|
||||
elif content_type == 'image/png':
|
||||
return 'png'
|
||||
elif content_type == 'image/webp':
|
||||
return 'webp'
|
||||
elif content_type == 'image/svg+xml':
|
||||
return 'svg'
|
||||
else:
|
||||
return None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user