branch: elpa/markdown-mode
commit 00858754c0e8e7b413a21862aac8387351486cfe
Merge: e250a84 6f97180
Author: Shohei YOSHIDA <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #579 from nobiot/feat/inline-image-size-no-imagemagick
Feat/inline image size no imagemagick
---
CHANGES.md | 1 +
markdown-mode.el | 16 ++++++++++------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 9a1d580..788cd1e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -24,6 +24,7 @@
- Enable flyspell check at yaml metadata[GH-560][]
- Clean up Makefile
- Support to display local image with percent encoding file path
+ - Add ability to resize inline image display
(`markdown-toggle-inline-images`) without Imagemagick installed in the computer
(emulating Org Mode)
* Bug fixes:
- Fix remaining flyspell overlay in code block or comment issue
[GH-311][]
diff --git a/markdown-mode.el b/markdown-mode.el
index b27ad49..64e5ac0 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8429,13 +8429,17 @@ or \\[markdown-toggle-inline-images]."
unhex_file
(concat default-directory unhex_file)))
(image
- (if (and markdown-max-image-size
+ (cond ((and markdown-max-image-size
(image-type-available-p 'imagemagick))
- (create-image
- abspath 'imagemagick nil
- :max-width (car markdown-max-image-size)
- :max-height (cdr markdown-max-image-size))
- (create-image abspath))))
+ (create-image
+ abspath 'imagemagick nil
+ :max-width (car markdown-max-image-size)
+ :max-height (cdr markdown-max-image-size)))
+ (markdown-max-image-size
+ (create-image abspath nil nil
+ :max-width (car
markdown-max-image-size)
+ :max-height (cdr
markdown-max-image-size)))
+ (t (create-image abspath)))))
(when image
(let ((ov (make-overlay start end)))
(overlay-put ov 'display image)