commit 07b98eb4f7252e3f64a306c09dfb618be6ac181d
parent cf87c16810a08c8eaed790e99c2bea5b3c9bb1ae
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date: Tue, 25 Sep 2018 17:28:35 +0200
org-download.el (org-download-image-org-width): Add
Fixes #80
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/org-download.el b/org-download.el
@@ -164,6 +164,11 @@ will be used."
:type 'integer
:group 'org-download)
+(defcustom org-download-image-org-width 0
+ "When non-zero add #+attr_org: :width tag to the image."
+ :type 'integer
+ :group 'org-download)
+
(defun org-download-get-heading (lvl)
"Return the heading of the current entry's LVL level parent."
(save-excursion
@@ -399,6 +404,9 @@ It's inserted before the image link and is used to annotate it.")
(if (= org-download-image-latex-width 0)
""
(format "#+attr_latex: :width %dcm\n" org-download-image-latex-width))
+ (if (= org-download-image-org-width 0)
+ ""
+ (format "#+attr_org: :width %dpx\n" org-download-image-org-width))
(format org-download-link-format
(org-link-escape
(file-relative-name filename (file-name-directory (buffer-name)))))))