unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Corwin Brust <corwin@bru.st>
To: Emanuel Berg <moasenwood@zoho.eu>, help-gnu-emacs@gnu.org
Subject: Re: Get the actual width/height of an image
Date: Mon, 14 Sep 2020 16:18:17 -0500	[thread overview]
Message-ID: <CAJf-WoTf2_smhv7KATJ-aFt1_JVvRc=sNEkhih-HPVvOtwB8XA@mail.gmail.com> (raw)
In-Reply-To: <87y2lc3wt0.fsf@ebih.ebihd>

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.


> For everything batch and graphics, use ImageMagick.

I think Emacs is moving away from ImageMagick and toward
"self-implemented" image manipulation &ct. functions.   Not that IM
has "gotten rusty" -- it isn't preferred from an elisp perspective
which could be important in terms of portability to other Emacsen.

>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>

Regards,
Corwin



  reply	other threads:[~2020-09-14 21:18 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 [this message]
2020-09-14 21:40     ` Yuan Fu
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='CAJf-WoTf2_smhv7KATJ-aFt1_JVvRc=sNEkhih-HPVvOtwB8XA@mail.gmail.com' \
    --to=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).