Fix directory handling

filename parameter can have PosixPath type and therefore should be
explicitly converted to string
This commit is contained in:
Andrey Kozlovskiy 2021-05-31 20:47:25 +03:00
parent c0f26b1fda
commit 9816201f26

View File

@ -62,7 +62,7 @@ def add_filechooser_filters(dialog):
def get_file_type(filename):
content_type, uncertain = Gio.content_type_guess(filename=filename)
content_type, uncertain = Gio.content_type_guess(filename=str(filename))
if not uncertain:
if content_type == 'image/jpeg':
return 'jpg'