Re: Cannot display local images with orgmode under macOS

2019-11-18 Thread Marco Wahl
Jack Kamm  writes:

> I've attached a patch which I believe fixes the issue.

Thanks.

> 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.

Your patch is on the branches master and next now.  I added the word
TINYCHANGE to your commit message.


Ciao



Re: [O] Cannot display local images with orgmode under macOS

2019-11-17 Thread Jack Kamm
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.

>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



Re: [O] Cannot display local images with orgmode under macOS

2019-11-17 Thread Jack Kamm
Hello,

I want to report that this bug is not specific to macOS, and also
affects Linux.

Specifically, I am running Archlinux-packaged emacs 26.3, and am
encountering this same issue. Ever since commit
48da60f47a77f4b99b4160fa620f258896ff4da3, org-mode no longer displays
inline images for me.

I tested this with "emacs -q" and an org-file with a link to a PNG image.

Jack



Re: [O] Cannot display local images with orgmode under macOS

2019-09-27 Thread Marco Wahl
Zhengyu Duan  writes:

> My image display problem was fixed with this commit
>
> https://github.com/hlissner/doom-emacs/commit/87b7a8da052601c51bc0577484916856364401cb

Thanks for the information!


Ciao,
-- 
Marco






Re: [O] Cannot display local images with orgmode under macOS

2019-09-27 Thread Zhengyu Duan
My image display problem was fixed with this commit

https://github.com/hlissner/doom-emacs/commit/87b7a8da052601c51bc0577484916856364401cb



> On Sep 14, 2019, at 15:43, Marco Wahl  wrote:
> 
> Hi!
> 
> Thanks all for checking the issue!
> 
>>>>> * The problem
>>>>> 
>>>>>   Orgmode under macOS cannot display local images correctly, but
>>>>> it can display internet images
>>>>> without problem.
>>>>> 
>>>>>   I tried both emacs-mac and emacs-plus, they both have this
>>>>> image problem. But emacs under
>>>>> ArchLinux don’t have this problem.
>>>>> 
>>>>>   [[file:xxx.png]] cannot be displayed even the file exists.
>>>>>   [[./xxx.png]] cannot be displayed even the file exists.
>>>>>   [[http://example.org/xxx.png]]  can be displayed if the link exists.
> 
> Your analysis hints to check the handling of images given by an url
> vs. given by file.  I think this is something for somewhen else.  (At
> least I captured a respective task.)
> 
> Regarding the issue about the display of inline images the tests
> can be summarized like this:
> 
> |   | OS  |  Emacs | magick | inline images |
> |   | ||| display   |
> |---+-+++---|
> | Duan  | arch||| yes   |
> | Duan  | mac ||| no|
> | Chuck | mac 10.14.6 |   26.1 | yes| yes   |
> | Tim   | mac 10.14.6 |   26.3 | yes| yes   |
> | Rick  | mac | master | no | yes   |
> 
> This is indication that there is an individual issue on Duan's side
> AFAICT.
> 
> I highly recommend to blend out the individual configuration and try
> again.  If the display still fails then provide a concrete minimal
> complete example for further invesigation.
> 
> 
> Thanks all and best regards,
> -- 
> Marco




Re: [O] Cannot display local images with orgmode under macOS

2019-09-14 Thread Marco Wahl
Hi!

Thanks all for checking the issue!

>>>> * The problem
>>>> 
>>>>    Orgmode under macOS cannot display local images correctly, but
>>>> it can display internet images
>>>> without problem.
>>>> 
>>>>I tried both emacs-mac and emacs-plus, they both have this
>>>> image problem. But emacs under
>>>> ArchLinux don’t have this problem.
>>>> 
>>>>[[file:xxx.png]] cannot be displayed even the file exists.
>>>>[[./xxx.png]] cannot be displayed even the file exists.
>>>>[[http://example.org/xxx.png]]  can be displayed if the link exists.

Your analysis hints to check the handling of images given by an url
vs. given by file.  I think this is something for somewhen else.  (At
least I captured a respective task.)

Regarding the issue about the display of inline images the tests
can be summarized like this:

|   | OS  |  Emacs | magick | inline images |
|   | ||| display   |
|---+-+++---|
| Duan  | arch||| yes   |
| Duan  | mac ||| no|
| Chuck | mac 10.14.6 |   26.1 | yes| yes   |
| Tim   | mac 10.14.6 |   26.3 | yes| yes   |
| Rick  | mac | master | no | yes   |

This is indication that there is an individual issue on Duan's side
AFAICT.

I highly recommend to blend out the individual configuration and try
again.  If the display still fails then provide a concrete minimal
complete example for further invesigation.


Thanks all and best regards,
-- 
Marco



Re: [O] Cannot display local images with orgmode under macOS

2019-09-13 Thread Rick Frankel
On Thu, Sep 12, 2019 at 02:48:15PM +0200, Marco Wahl wrote:
> Hi,
> >     Orgmode under macOS cannot display local images correctly, but it can 
> > display internet images
> > without problem.

> > After bisecting org-mode source code I found out that this commit 
> > causes the problem:
> >
> > 
> > https://code.orgmode.org/bzg/org-mode/commit/48da60f47a77f4b99b4160fa620f258896ff4da3
> >
> > Reverting to previous commit fixes the problem.
>
> Gaa!  Looks like I did this.  With the commit one should be able to see
> inline images also in the case when Emacs has been build without
> imagemagick support, at least for newer Emacsens in the 27 line.
>
> Unfortunately I don't have a Mac and cannot examine the behavior you
> describe AFAICS.
>

On a mac, latest org and emacs masters, inline images work find

Org version:

  commit 6f32e7af88805441c1261e16f729172639d8b3fa (HEAD -> master, 
origin/master, origin/HEAD)


Abbreviated emacs config output (no imagemagick):

  What compiler should emacs be built with?   clang -O
  What window system should Emacs use?nextstep
  What toolkit should Emacs use?  none
  Does Emacs use -lXaw3d? no
  Does Emacs use -lXpm?   no
  Does Emacs use -ljpeg?  no
  Does Emacs use -ltiff?  no
  Does Emacs use a gif library?   no
  Does Emacs use a png library?   no
  Does Emacs use -lrsvg-2?yes
  Does Emacs use cairo?   no
  Does Emacs use -llcms2? yes
  Does Emacs use imagemagick? no
  Does Emacs use -lgmp?   yes
  Does Emacs directly use zlib?   yes
  Does Emacs have dynamic modules support?no
  Does Emacs use toolkit scroll bars? yes
  Does Emacs support Xwidgets (requires gtk3)?no



Re: [O] Cannot display local images with orgmode under macOS

2019-09-12 Thread Tim Cross


Running Emacs 26.3 on macOS 10.14.6 with latest org and I have no
problems displaying images in org mode. I have imagemagick installed and
am using railwaycat's mac-port via homebrew.

Tim
Berry, Charles  writes:

>> On Sep 12, 2019, at 5:48 AM, Marco Wahl  wrote:
>> 
>> Hi,
>> 
>>> * The problem
>>> 
>>>Orgmode under macOS cannot display local images correctly, but it can 
>>> display internet images
>>> without problem.
>>> 
>>>I tried both emacs-mac and emacs-plus, they both have this image 
>>> problem. But emacs under
>>> ArchLinux don’t have this problem.
>>> 
>>>[[file:xxx.png]]  cannot be displayed even 
>>> the file exists.
>>>[[./xxx.png]]  cannot be displayed even 
>>> the file exists.
>>>[[http://example.org/xxx.png]]  can be displayed if the link exists.
>>> 
>>>Emacs can display any images with C-x C-f xxx.png. The problem happens 
>>> only with orgmode.
>>> 
>>> * The reason
>>> 
>>>After bisecting org-mode source code I found out that this commit causes 
>>> the problem:
>>> 
>>>
>>> https://code.orgmode.org/bzg/org-mode/commit/48da60f47a77f4b99b4160fa620f258896ff4da3
>>> 
>>>Reverting to previous commit fixes the problem.
>> 
>> Gaa!  Looks like I did this.  With the commit one should be able to see
>> inline images also in the case when Emacs has been build without
>> imagemagick support, at least for newer Emacsens in the 27 line.
>> 
>> Unfortunately I don't have a Mac and cannot examine the behavior you
>> describe AFAICS.
>> 
>> Hopefully a Org community member with access to a Mac can have a look.
>> 
>> 
>
>
> I just updated org, I can see the offending commit.
>
> After refreshing, I have no problems toggling display of inline images.
>
> I have imagemagick and dvipng installed.
>
> MacOS 10.14.6, Emacs 26.1, org release_9.2.6-534-g6f32e7
>
> Is there anything else I can tell you?
>
> HTH,
>
> Chuck


-- 
Tim Cross



Re: [O] Cannot display local images with orgmode under macOS

2019-09-12 Thread Berry, Charles


> On Sep 12, 2019, at 5:48 AM, Marco Wahl  wrote:
> 
> Hi,
> 
>> * The problem
>> 
>>    Orgmode under macOS cannot display local images correctly, but it can 
>> display internet images
>> without problem.
>> 
>>I tried both emacs-mac and emacs-plus, they both have this image problem. 
>> But emacs under
>> ArchLinux don’t have this problem.
>> 
>>[[file:xxx.png]]  cannot be displayed even 
>> the file exists.
>>[[./xxx.png]]  cannot be displayed even 
>> the file exists.
>>[[http://example.org/xxx.png]]  can be displayed if the link exists.
>> 
>>Emacs can display any images with C-x C-f xxx.png. The problem happens 
>> only with orgmode.
>> 
>> * The reason
>> 
>>After bisecting org-mode source code I found out that this commit causes 
>> the problem:
>> 
>>
>> https://code.orgmode.org/bzg/org-mode/commit/48da60f47a77f4b99b4160fa620f258896ff4da3
>> 
>>Reverting to previous commit fixes the problem.
> 
> Gaa!  Looks like I did this.  With the commit one should be able to see
> inline images also in the case when Emacs has been build without
> imagemagick support, at least for newer Emacsens in the 27 line.
> 
> Unfortunately I don't have a Mac and cannot examine the behavior you
> describe AFAICS.
> 
> Hopefully a Org community member with access to a Mac can have a look.
> 
> 


I just updated org, I can see the offending commit.

After refreshing, I have no problems toggling display of inline images.

I have imagemagick and dvipng installed.

MacOS 10.14.6, Emacs 26.1, org release_9.2.6-534-g6f32e7

Is there anything else I can tell you?

HTH,

Chuck




Re: [O] Cannot display local images with orgmode under macOS

2019-09-12 Thread Marco Wahl
Hi,

> * The problem
>
>     Orgmode under macOS cannot display local images correctly, but it can 
> display internet images
> without problem.
>
> I tried both emacs-mac and emacs-plus, they both have this image problem. 
> But emacs under
> ArchLinux don’t have this problem.
>
> [[file:xxx.png]]  cannot be displayed even 
> the file exists.
> [[./xxx.png]]  cannot be displayed even 
> the file exists.
> [[http://example.org/xxx.png]]  can be displayed if the link exists.
>
> Emacs can display any images with C-x C-f xxx.png. The problem happens 
> only with orgmode.
>
> * The reason
>
> After bisecting org-mode source code I found out that this commit causes 
> the problem:
>
> 
> https://code.orgmode.org/bzg/org-mode/commit/48da60f47a77f4b99b4160fa620f258896ff4da3
>
> Reverting to previous commit fixes the problem.

Gaa!  Looks like I did this.  With the commit one should be able to see
inline images also in the case when Emacs has been build without
imagemagick support, at least for newer Emacsens in the 27 line.

Unfortunately I don't have a Mac and cannot examine the behavior you
describe AFAICS.

Hopefully a Org community member with access to a Mac can have a look.


Thanks for reporting,
-- 
Marco