all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Evgeny Zajcev <lg.zevlg@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Lazy image converters
Date: Wed, 12 Feb 2020 17:11:02 +0300	[thread overview]
Message-ID: <CAO=W_ZoDtv8oULLy-TrCDzB7zA8czK8NM8cZL=KrQ6K7+hr8pQ@mail.gmail.com> (raw)

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

It is a nice feature in Emacs 27 - 'image-convert' type for the images.
To convert unsupported images to format Emacs can understand.

Normally image creation (with 'create-image') is a very lightweight
process, Emacs don't read the files or do any heavy things.  All heavy
things are done in redisplay, so you could create and insert 1000 images in
the buffer with a couple of them visible and this will be fast.

However, with 'image-convert' images, this won't work, because heavy things
are done in the 'create-image', not in redisplay.  So Emacs will convert
1000 images at once.

What if we have a lazy image, so its FILE-OR-DATA is calculated at
redisplay time.  'image-convert' could utilize this.  One of the approaches
to lazy images is to allow FILE-OR-DATA to be a function returning actual
file or data.  Redisplay could call this func and substitute the value of
FILE-OR-DATA in image spec with the results, kind of caching the results.

What do you think?

Thanks

-- 
lg

[-- Attachment #2: Type: text/html, Size: 1293 bytes --]

             reply	other threads:[~2020-02-12 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 14:11 Evgeny Zajcev [this message]
2020-02-16 13:06 ` Lazy image converters Lars Ingebrigtsen
2020-02-16 17:45   ` Evgeny Zajcev
2020-02-19 13:44     ` Lars Ingebrigtsen
2020-02-16 15:20 ` Stefan Monnier
2020-02-17 11:02   ` Evgeny Zajcev

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

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

  git send-email \
    --in-reply-to='CAO=W_ZoDtv8oULLy-TrCDzB7zA8czK8NM8cZL=KrQ6K7+hr8pQ@mail.gmail.com' \
    --to=lg.zevlg@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 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.