help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Get the actual width/height of an image


From: Yuan Fu
Subject: Re: Get the actual width/height of an image
Date: Mon, 14 Sep 2020 17:40:12 -0400


> On Sep 14, 2020, at 5:18 PM, Corwin Brust <corwin@bru.st> wrote:
> 
> Greetings!
> 
> On Mon, Sep 14, 2020 at 3:53 PM Emanuel Berg via Users list for the
> GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>> 
>> Yuan Fu wrote:
>> 
>>> There doesn’t seem to be a function to get the
>>> aspect ratio of the image, or the actual pixel
>>> height/width of the image. So can I get
>>> this information?
> 
> 
> I think we can get the dimensions from `image-size', but note the
> PIXELS argument:
> 
> (image-size SPEC &optional PIXELS FRAME)
> 
>  | Documentation
>  | Return the size of image SPEC as pair (WIDTH . HEIGHT).
> 
>  | PIXELS non-nil means return the size in pixels, otherwise return the
>  | size in canonical character units.
> 
>  | FRAME is the frame on which the image will be displayed.  FRAME nil
>  | or omitted means use the selected frame.
> 
>  | Calling this function will result in the image being stored in the
>  | image cache.  If this is not desirable, call image-flush after
>  | calling this function.
> 
> 

Wow, exactly what I want! Wonder why I missed it when reading Info. Thanks!

Yuan




reply via email to

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