* Error with inline image resizing
@ 2016-08-02 8:46 Takeshi Teshima
2016-08-07 20:51 ` John Kitchin
0 siblings, 1 reply; 2+ messages in thread
From: Takeshi Teshima @ 2016-08-02 8:46 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]
Hi all,
When I try to show inline images automatically resized in an org-mode
buffer, the thumbnail doesn't show (a big blank box shows where the resized
image should be) and the following errors are echoed in the "*Messages*"
buffer.
```
ImageMagick error: no decode delegate for this image format `JPEG' @
error/constitute.c/ReadImage/504
```
The image types I have tried are JPG and PNG.
When tried with a PNG file, the error message changes to
```
ImageMagick error: no decode delegate for this image format `PNG' @
error/constitute.c/ReadImage/504
```
* [Related settings]:
** init.el
`(setq org-image-actual-width nil)`
** the org-mode file
```
#+ATTR_LATEX: :width 300pt
[[file:20160802-142357_2016-08-02_13.35.28-1.jpg]]
```
I tried this with Emacs running in the safe mode, i.e. running with "-q"
option.
The inline image shows correctly (with the original size) until I set
`org-image-actual-width` to `nil`, after which I don't see the image in the
buffer
(A big blank box appears where the image should be. I also see the errors
mentioned above in the "*Messages*" buffer.).
* [Current workaround I use]:
It doesn't occur when I use the snippet in this SO answer.
http://stackoverflow.com/questions/17637685/configuring-emacs-for-showing-fixed-width-inline-images
It basically rewrites org-display-inline-images function.
* [Environmental information]:
** (i) I built my Emacs using the following tool:
https://github.com/renard/emacs-build-macosx
by running `./build-emacs emacs-24.5`.
It was built with ImageMagick, and I can correctly export LaTeX formula
with it.
Also it works fine when I don't use the resize feature, i.e.
`org-image-actual-width` is set to `t`.
** (ii) Versions
*** Emacs: emacs-24.5.50.1
*** Mac OS X: El Capitan 10.11.6(15G31).
*** $ convert --version
Version: ImageMagick 6.9.5-1 Q16 x86_64 2016-07-15
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff webp xml
zlib
Thank you very much in advance.
diadochos
[-- Attachment #2: Type: text/html, Size: 3624 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Error with inline image resizing
2016-08-02 8:46 Error with inline image resizing Takeshi Teshima
@ 2016-08-07 20:51 ` John Kitchin
0 siblings, 0 replies; 2+ messages in thread
From: John Kitchin @ 2016-08-07 20:51 UTC (permalink / raw)
To: Takeshi Teshima; +Cc: emacs-orgmode
You could try this approach
https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L957 to
line 1109. It uses the external ImageMagick command mogrify to
resize the images. It monkeypatches org-display-inline-images to do
that.
Takeshi Teshima writes:
> Hi all,
>
> When I try to show inline images automatically resized in an org-mode
> buffer, the thumbnail doesn't show (a big blank box shows where the resized
> image should be) and the following errors are echoed in the "*Messages*"
> buffer.
>
> ```
> ImageMagick error: no decode delegate for this image format `JPEG' @
> error/constitute.c/ReadImage/504
> ```
>
> The image types I have tried are JPG and PNG.
> When tried with a PNG file, the error message changes to
> ```
> ImageMagick error: no decode delegate for this image format `PNG' @
> error/constitute.c/ReadImage/504
> ```
>
> * [Related settings]:
>
> ** init.el
>
> `(setq org-image-actual-width nil)`
>
> ** the org-mode file
>
> ```
>
> #+ATTR_LATEX: :width 300pt
>
> [[file:20160802-142357_2016-08-02_13.35.28-1.jpg]]
>
> ```
>
> I tried this with Emacs running in the safe mode, i.e. running with "-q"
> option.
>
> The inline image shows correctly (with the original size) until I set
> `org-image-actual-width` to `nil`, after which I don't see the image in the
> buffer
>
> (A big blank box appears where the image should be. I also see the errors
> mentioned above in the "*Messages*" buffer.).
>
> * [Current workaround I use]:
> It doesn't occur when I use the snippet in this SO answer.
> http://stackoverflow.com/questions/17637685/configuring-emacs-for-showing-fixed-width-inline-images
> It basically rewrites org-display-inline-images function.
>
> * [Environmental information]:
> ** (i) I built my Emacs using the following tool:
> https://github.com/renard/emacs-build-macosx
> by running `./build-emacs emacs-24.5`.
> It was built with ImageMagick, and I can correctly export LaTeX formula
> with it.
> Also it works fine when I don't use the resize feature, i.e.
> `org-image-actual-width` is set to `t`.
>
> ** (ii) Versions
> *** Emacs: emacs-24.5.50.1
> *** Mac OS X: El Capitan 10.11.6(15G31).
>
> *** $ convert --version
>
> Version: ImageMagick 6.9.5-1 Q16 x86_64 2016-07-15
> http://www.imagemagick.org
>
> Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
>
> License: http://www.imagemagick.org/script/license.php
>
> Features: Cipher DPC Modules
>
> Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff webp xml
> zlib
>
>
> Thank you very much in advance.
>
> diadochos
--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-07 20:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 8:46 Error with inline image resizing Takeshi Teshima
2016-08-07 20:51 ` John Kitchin
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.