[Top][All Lists]

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

Re: Get the actual width/height of an image

From: Corwin Brust
Subject: Re: Get the actual width/height of an image
Date: Mon, 14 Sep 2020 16:18:17 -0500


On Mon, Sep 14, 2020 at 3:53 PM Emanuel Berg via Users list for the
GNU Emacs text editor <> 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


reply via email to

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