From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Kamm Subject: Re: Cannot display local images with orgmode under macOS Date: Sun, 17 Nov 2019 14:55:36 -0800 Message-ID: <874kz2nmdz.fsf@gmail.com> References: <84lfutel4g.fsf@gmail.com> <87h832o3wf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47328) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWTSc-0002VT-Rb for emacs-orgmode@gnu.org; Sun, 17 Nov 2019 17:56:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWTSb-0005oI-Je for emacs-orgmode@gnu.org; Sun, 17 Nov 2019 17:56:02 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:41975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iWTSb-0005o3-CP for emacs-orgmode@gnu.org; Sun, 17 Nov 2019 17:56:01 -0500 Received: by mail-pf1-x434.google.com with SMTP id p26so9379707pfq.8 for ; Sun, 17 Nov 2019 14:56:01 -0800 (PST) In-Reply-To: <87h832o3wf.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Marco Wahl , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain I've attached a patch which I believe fixes the issue. The problem appears to be that, when imagemagick is installed and the image width is unset, that the image will be created by an elisp expression like (create-file "some/image.png" 'imagemagick nil :width nil) which doesn't work, maybe because imagemagick tries to create a 0-width image. The attached patch reverts to the old behavior of only using imagemagick when width is non-nil, fixing the bug introduced by 48da60f47. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-Fix-images-failing-to-display-with-imagemagick.patch >From cebf2b4001015dabc74364ac2a5bf2ed64c07ab0 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Sun, 17 Nov 2019 14:30:35 -0800 Subject: [PATCH] org: Fix images failing to display with imagemagick See also: https://lists.gnu.org/archive/html/emacs-orgmode/2019-09/msg00111.html Despite the subject of that message thread, the issue also affects some Linux users. --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index f29298266..b65b7d221 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16755,7 +16755,8 @@ boundaries." (if (and (car-safe old) refresh) (image-refresh (overlay-get (cdr old) 'display)) (let ((image (create-image file - (and (image-type-available-p 'imagemagick) 'imagemagick) + (and (image-type-available-p 'imagemagick) + width 'imagemagick) nil :width width))) (when image -- 2.24.0 --=-=-=--