emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jack Kamm <jackkamm@gmail.com>
To: Marco Wahl <marcowahlsoft@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Cannot display local images with orgmode under macOS
Date: Sun, 17 Nov 2019 14:55:36 -0800	[thread overview]
Message-ID: <874kz2nmdz.fsf@gmail.com> (raw)
In-Reply-To: <87h832o3wf.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-Fix-images-failing-to-display-with-imagemagick.patch --]
[-- Type: text/x-patch, Size: 949 bytes --]

From cebf2b4001015dabc74364ac2a5bf2ed64c07ab0 Mon Sep 17 00:00:00 2001
From: Jack Kamm <jackkamm@gmail.com>
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


  reply	other threads:[~2019-11-17 22:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  2:33 Cannot display local images with orgmode under macOS Zhengyu Duan
2019-09-12 12:48 ` Marco Wahl
2019-09-12 17:02   ` Berry, Charles
2019-09-13  4:37     ` Tim Cross
2019-09-14  7:43       ` Marco Wahl
2019-09-27 10:30         ` Zhengyu Duan
2019-09-27 16:27           ` Marco Wahl
2019-09-13 11:50   ` Rick Frankel
2019-11-17 16:37   ` Jack Kamm
2019-11-17 22:55     ` Jack Kamm [this message]
2019-11-18 21:58       ` Marco Wahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kz2nmdz.fsf@gmail.com \
    --to=jackkamm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marcowahlsoft@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).