org-download

a fork of abo-abo's org-download
git clone https://git.trogloxene.org/org-download.git
Log | Files | Refs | README

commit 8bc54b6c1a7ac70c4d871ba9e2313035465e18b1
parent ac72bf8fce3e855da60687027b6b8601cf1de480
Author: Feng Shu <tumashu@163.com>
Date:   Wed, 21 Aug 2019 13:01:41 +0800

Remove thumbnail function for unstable reason.

Diffstat:
Morg-download.el | 47++++++++++++-----------------------------------
1 file changed, 12 insertions(+), 35 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -191,46 +191,23 @@ For example: :poshandler posframe-poshandler-window-center) "List of parameters passed to `posframe-show'.") -(defcustom org-download-thumbnail-file - (expand-file-name "org-download-thumbnail.png" temporary-file-directory) - "The file to thumbnail of `org-download-path-last-file'." - :type 'file) - -(defcustom org-download-thumbnail-function - #'org-download-thumbnail-default - "The tool to create screenshot's thumbnail." - :type 'function) - -(defun org-download-thumbnail-default (image-file thumbnail-file) - "Create the THUMBNAIL of IMAGE" - (cond - ((executable-find "convert") - (shell-command-to-string (format "convert -resize 400 %s %s" - image-file thumbnail-file))) - (t - (message "org-download: fail to create thumbnail, use original image instead.") - (copy-file image-file thumbnail-file t)))) - (declare-function posframe-workable-p "ext:posframe") (declare-function posframe-show "ext:posframe") (defun org-download--display-inline-images () (cond - ((eq org-download-display-inline-images t) - (org-display-inline-images)) - ((eq org-download-display-inline-images 'posframe) - (require 'posframe) - (when (posframe-workable-p) - (let ((buffer (get-buffer-create " *org-download-image"))) - (funcall org-download-thumbnail-function - org-download-path-last-file - org-download-thumbnail-file) - (with-current-buffer buffer - (erase-buffer) - (insert-image-file org-download-thumbnail-file)) - (apply #'posframe-show - buffer - org-download-posframe-show-params)))))) + ((eq org-download-display-inline-images t) + (org-display-inline-images)) + ((eq org-download-display-inline-images 'posframe) + (require 'posframe) + (when (posframe-workable-p) + (let ((buffer (get-buffer-create " *org-download-image"))) + (with-current-buffer buffer + (erase-buffer) + (insert-image-file org-download-path-last-file)) + (apply #'posframe-show + buffer + org-download-posframe-show-params)))))) (defun org-download-get-heading (lvl) "Return the heading of the current entry's LVL level parent."