emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image-size


From: Lars Magne Ingebrigtsen
Subject: Re: image-size
Date: Thu, 20 Jun 2013 22:57:10 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> I can't see anything in the imagemagick code that talks to X, so I think
>> it's a general Emacs image thingie.
>
> IT CANNOT BE TRUE!!!!  IF IT WERE TRUE, I COULD NOT HAVE USED IMAGES
> ON WINDOWS, where there's no X.

Of course there is no X stuff on Windows.  But if you're running over X,
lookup_image pushes data over X, for some reason or other.  I have no
idea what the reason might be, but perhaps somebody else does.

>> 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.
>
> If it is in the cache, Emacs will fetch it from there.

It would decode twice with the two-part `image-size'/`put-image' code,
since `image-size' would then not put things into the cache.

As Chong said:

> You have to replace the call to lookup_image in `image-size' with a
> new function that avoids loading the image.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]