all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Lazy image converters
@ 2020-02-12 14:11 Evgeny Zajcev
  2020-02-16 13:06 ` Lars Ingebrigtsen
  2020-02-16 15:20 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Evgeny Zajcev @ 2020-02-12 14:11 UTC (permalink / raw)
  To: emacs-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-19 13:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-12 14:11 Lazy image converters Evgeny Zajcev
2020-02-16 13:06 ` 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

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.