From: Yuan Fu <casouri@gmail.com>
To: Corwin Brust <corwin@bru.st>
Cc: help-gnu-emacs@gnu.org, Emanuel Berg <moasenwood@zoho.eu>
Subject: Re: Get the actual width/height of an image
Date: Mon, 14 Sep 2020 17:40:12 -0400 [thread overview]
Message-ID: <421A2ADC-01F5-4395-A6F1-20F095B54D32@gmail.com> (raw)
In-Reply-To: <CAJf-WoTf2_smhv7KATJ-aFt1_JVvRc=sNEkhih-HPVvOtwB8XA@mail.gmail.com>
> 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
next prev parent reply other threads:[~2020-09-14 21:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 20:22 Get the actual width/height of an image Yuan Fu
2020-09-14 20:52 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-14 21:18 ` Corwin Brust
2020-09-14 21:40 ` Yuan Fu [this message]
2020-09-14 22:20 ` Stefan Monnier
2020-09-15 0:13 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-15 13:43 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=421A2ADC-01F5-4395-A6F1-20F095B54D32@gmail.com \
--to=casouri@gmail.com \
--cc=corwin@bru.st \
--cc=help-gnu-emacs@gnu.org \
--cc=moasenwood@zoho.eu \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).