Fix mime type info for converted images. Fixes #307

This commit is contained in:
Tulir Asokan
2019-05-11 19:17:10 +03:00
parent 430f7b7217
commit c50fd4b3ac
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -1386,7 +1386,11 @@ class Portal:
except ValueError:
name = alt
mime_type = document.mime_type or file.mime_type
generic_types = ("text/plain", "application/octet-stream")
if file.mime_type in generic_types and document.mime_type not in generic_types:
mime_type = document.mime_type or file.mime_type
else:
mime_type = file.mime_type or document.mime_type
info = {
"size": file.size,
"mimetype": mime_type,