Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
Fix: Get image type from file header if no extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alphapapa committed Oct 10, 2018
1 parent a1b4c3f commit e1f5eb5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion matrix-api-r0.3.0.el
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,9 @@ TYPING should be t or nil."
((eieio server) session)
(filename (file-name-nondirectory path))
(extension (file-name-extension filename))
(mime-type (mailcap-extension-to-mime extension))
(mime-type (cond (extension (mailcap-extension-to-mime extension))
(t (mailcap-extension-to-mime (symbol-name (or (image-type-from-file-header path)
(error "Can't determine image type'")))))))
(file-contents (with-temp-buffer
(insert-file-contents path)
(buffer-string)))
Expand Down

0 comments on commit e1f5eb5

Please sign in to comment.