all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: image-size
Date: Thu, 20 Jun 2013 21:52:29 +0200	[thread overview]
Message-ID: <m3bo70y2yq.fsf@stories.gnus.org> (raw)
In-Reply-To: <83mwqko9ge.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 20 Jun 2013 22:42:25 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> Is this using imagemagick or using libjpeg?

imagemagick.

> If the former, perhaps imagemagick is the only library that needs your
> "fast path".  The other image libraries don't, as they clearly don't
> write to X (otherwise I couldn't have used them on Windows).

I can't see anything in the imagemagick code that talks to X, so I think
it's a general Emacs image thingie.

Anybody?

Anyway, this has led me to consider this a bit more.  Sure, this is
faster than 46 seconds:

(benchmark-elapse (image-size (create-image "/home/larsi/Catalogue/html/scans/BAD0013/BAD0013-1-l.jpg") t))
=> 0.226372938

But on the other hand, the next time we open the file to scale it down,
we'll have to decode the image yet again, which will take 0.23 seconds
once again.

Wouldn't it be nice if we could just pass in :max-width and :max-height
to `create-image', and `put-image' would then respect this when actually
creating the image?

Then the image would only have to be decoded once, and we'd have the
best of both worlds.  All other uses of `image-size' that I can see in
shr are for images that are or will definitely be inserted, so they'll
already have been (or will be) transferred over X.

So it fits my use case, and will make displaying sensibly-sized images
fast and convenient in general.  (If you have imagemagick, that is.
Most of the other image renderers don't support resizing, and ignore
:width and :height, so they should also ignore :max-width and
:max-height.)

Opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



  reply	other threads:[~2013-06-20 19:52 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 10:04 image-size Lars Magne Ingebrigtsen
2013-06-20 12:18 ` image-size Lars Magne Ingebrigtsen
2013-06-20 16:52   ` image-size Eli Zaretskii
2013-06-20 16:01 ` image-size Eli Zaretskii
2013-06-20 16:50   ` image-size Lars Magne Ingebrigtsen
2013-06-20 16:55     ` image-size Lars Magne Ingebrigtsen
2013-06-20 17:16       ` image-size Eli Zaretskii
2013-06-20 17:54         ` image-size Lars Magne Ingebrigtsen
2013-06-20 18:15           ` image-size Eli Zaretskii
2013-06-20 18:31             ` image-size Eli Zaretskii
2013-06-20 18:46               ` image-size Lars Magne Ingebrigtsen
2013-06-20 19:11                 ` image-size Eli Zaretskii
2013-06-20 19:18                   ` image-size Lars Magne Ingebrigtsen
2013-06-20 19:37                     ` image-size Eli Zaretskii
2013-06-20 19:52                       ` image-size David Engster
2013-06-20 20:50                         ` image-size Eli Zaretskii
2013-06-20 19:34                   ` image-size Lars Magne Ingebrigtsen
2013-06-20 19:42                     ` image-size Eli Zaretskii
2013-06-20 19:52                       ` Lars Magne Ingebrigtsen [this message]
2013-06-20 20:53                         ` image-size Eli Zaretskii
2013-06-20 20:57                           ` image-size Lars Magne Ingebrigtsen
2013-06-20 21:06                             ` image-size Lars Magne Ingebrigtsen
2013-06-21  6:12                               ` image-size Eli Zaretskii
2013-06-20 21:42                             ` image-size Jan Djärv
2013-06-21  0:46                               ` image-size YAMAMOTO Mitsuharu
2013-06-21  6:27                                 ` image-size Lars Magne Ingebrigtsen
2013-06-26  8:25                                   ` image-size YAMAMOTO Mitsuharu
2013-06-26 10:39                                     ` image-size YAMAMOTO Mitsuharu
2013-06-26 12:04                                     ` image-size Lars Magne Ingebrigtsen
2013-06-27  0:46                                       ` image-size Lars Magne Ingebrigtsen
2013-06-27  2:49                                         ` image-size Stefan Monnier
2013-06-28  2:46                                       ` image-size YAMAMOTO Mitsuharu
2013-06-28  3:12                                         ` image-size Juanma Barranquero
2013-06-28  3:45                                           ` image-size YAMAMOTO Mitsuharu
2013-06-21  6:15                               ` image-size Eli Zaretskii
2013-06-21  7:34                                 ` image-size Jan Djärv
2013-06-21  8:27                                   ` image-size Eli Zaretskii
2013-06-21  9:03                                     ` image-size Jan Djärv
2013-06-21  9:07                                       ` image-size Lars Magne Ingebrigtsen
2013-06-21  9:58                                         ` image-size Eli Zaretskii
2013-06-21  9:57                                       ` image-size Eli Zaretskii
2013-06-21  6:13                             ` image-size Eli Zaretskii
2013-06-21 15:54                               ` image-size Willem Rein Oudshoorn

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=m3bo70y2yq.fsf@stories.gnus.org \
    --to=larsi@gnus.org \
    --cc=eliz@gnu.org \
    --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.