[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/markdown-mode fc733be 1/8: feat: Add resize inline image w
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/markdown-mode fc733be 1/8: feat: Add resize inline image without imagemagick |
Date: |
Wed, 6 Jan 2021 19:57:11 -0500 (EST) |
branch: elpa/markdown-mode
commit fc733be3777c281d5d5e06dacf71cc43109e4a1f
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
feat: Add resize inline image without imagemagick
This is a small enahcnement to `markdown-toggle-inline-images`,
adding a feature to resize the inline display of the image without the need
for Imagemagick present in the computer.
It uses the existing variable `markdown-max-image-size` to
determine the size.
Org Mode now is able to do this (see the code in the link below). This
feature
is intended to emulate it in Markdown-mode.
https://github.com/bzg/org-mode/blob/abedf386b3f13af2769728755d00c4698ac5d3b0/lisp/org.el#L16344-L16349
(create-image file-or-data
(and (image-type-available-p 'imagemagick)
width
'imagemagick)
remote?
:width width))))
---
markdown-mode.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
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)
- [nongnu] elpa/markdown-mode updated (e250a84 -> 137696f), ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode fc733be 1/8: feat: Add resize inline image without imagemagick,
ELPA Syncer <=
- [nongnu] elpa/markdown-mode 0085875 4/8: Merge pull request #579 from nobiot/feat/inline-image-size-no-imagemagick, ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode 6724a2c 5/8: Added optional support for inserting braces in GFM code block header, ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode 6f97180 3/8: Update CHANGELOG, ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode da7b9df 2/8: Update CHANGELOG, ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode d5106ff 6/8: Add unit test for markdown code block braces, ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode ec6ae58 7/8: Merge remote-tracking branch 'origin/master' into pr-581, ELPA Syncer, 2021/01/06
- [nongnu] elpa/markdown-mode 137696f 8/8: Merge branch 'pr-581', ELPA Syncer, 2021/01/06