Skip to content

misohena/org-inline-image-fix

Repository files navigation

org-mode Inline Image Fix

This repository is a collection of fixes related to the image display feature in org-mode.

All the fixes are done by force using advice and cl-letf, so there is a possibility that it will not work due to the version upgrade of org-mode.

Data URI Support(org-datauri-image.el)

  • Display data URI link as inline image
  • Export data URI (HTML backend only)

Setup

(with-eval-after-load "org"
  (require 'org-datauri-image)
  (org-datauri-image-activate))

To use display inline images only:

(with-eval-after-load "org"
  (require 'org-datauri-image)
  (org-datauri-image-activate-display))

Example

Red Circle:
[[data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTAwIiB3aWR0aD0iMTAwIj4NCiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iNDAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMyIgZmlsbD0icmVkIiAvPg0KPC9zdmc+DQo=]]
Fuji-san!:
[[data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAeAAD/7gAOQWRvYmUAZMAAAAAB/9sAhAAQCwsLDAsQDAwQFw8NDxcbFBAQFBsfFxcXFxcfHhcaGhoaFx4eIyUnJSMeLy8zMy8vQEBAQEBAQEBAQEBAQEBAAREPDxETERUSEhUUERQRFBoUFhYUGiYaGhwaGiYwIx4eHh4jMCsuJycnLis1NTAwNTVAQD9AQEBAQEBAQEBAQED/wAARCAAyAGQDASIAAhEBAxEB/8QAgAAAAgMBAAAAAAAAAAAAAAAAAAMBAgQFAQADAQEBAAAAAAAAAAAAAAAAAQIDBAUQAAEDAgQDBQYFBQAAAAAAAAEAAgMRBCExQRJRYQVxgcEiE/CRoTJCI9FighQGsVJy0hURAAICAQUBAQAAAAAAAAAAAAABEQIhMUFxEgNhIv/aAAwDAQACEQMRAD8A3UUUTdqjavTk4RdEbUyiCESAvaooupadIkkHq3NYos9uTz/qtEsdrb27nmNvosxNBU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ADOHjn3KW/j2IQkUU+kZ69in2xQhMRX3IQhAj/2Q==]]

Supported URI Format

“data:image/” ( “png” | “jpeg” | “gif” | “svg+xml” ) “;base64,” base64string

Limit Inline Image Size(org-limit-image-size.el)

This extension just adds :max-width and :max-height to inline images. This prevents images from overflowing the frames.

Setup

(with-eval-after-load "org"
  (require 'org-limit-image-size)
  (org-limit-image-size-activate))

Customization Variables

org-limit-image-size
Specify the maximum size of the images.
integer
Pixels width and height
float
Rate of frame size
(cons integer-or-float integer-or-float)
Cons of width and height

Development Note

http://misohena.jp/blog/2020-05-26-limit-maximum-inline-image-size-in-org-mode.html

Automatic Image Update

Automatically update inline images without org-toggle-inline-images and org-redisplay-inline-images.

Setup

(with-eval-after-load "org"
  (require 'org-flyimage)
  (add-hook 'org-mode-hook 'org-flyimage-mode))

Development Note

http://misohena.jp/blog/2020-05-25-auto-update-inline-images-in-org-mode.html

Display HTTP Images(org-http-inline-image.el)

Display HTTP/HTTPS image link inline. All images are download every time.

Setup

(with-eval-after-load "org"
  (require 'org-http-inline-image)
  (org-http-inline-image-activate))

Development Note

http://misohena.jp/blog/2012-03-11-120311a.html

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About registration to package distribution systems

For various reasons, it is difficult for me to register packages with the package distribution systems (package archives).

If you wish to register this package with the package archives, please feel free to fork this repository and proceed with the registration and maintenance on your own. No permission is required.

The reasons are that communication in English is a burden, it is not necessary for me, It is fair for those who need it to bear the cost, I want to reserve the right to develop in a free coding style, etc. .

If someone else creates a better solution, I will gladly use it. Ideally, the original project should be improved so that a need for this does not arise, but please don’t expect me to negotiate for that.

From someone who took hours using translation software to write this section.

Releases

No releases published

Packages

No packages published