GNU bug report logs - #44172
28.0.50; Exporting image data

Previous Next

Package: emacs;

Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>

Date: Fri, 23 Oct 2020 11:19:02 UTC

Severity: normal

Merged with 49347

Found in version 28.0.50

Full log


Message #14 received at 44172 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44172 <at> debbugs.gnu.org
Subject: Re: bug#44172: 28.0.50; Exporting image data
Date: Fri, 23 Oct 2020 17:24:19 +0100
On Fri, Oct 23, 2020 at 01:18:40PM +0200, Lars Ingebrigtsen wrote:
> 
> 1) Making image data available to Emacs Lisp.
> 
> This is something that I've often wanted for other reasons -- I want to
> know how an SVG was rendered, for instance (especially when doing
> font-based stuff), and there's no way to actually tell.
> 
> So I think Emacs should have a function like
> 
> (export-image-data IMAGE &rest SPECS)
> 
> that will just take the image cache data for IMAGE (or the frame
> specified by SPECS, if multi-frame) and dump the RGB(A) data into the
> current buffer (which should be unibyte, for efficiency), and return
> a plist of width/height/bytes-per-pixel/rgb(a) ordering.  This is
> basically the PPM binary format, but without the heading.
> 
> This allows us to do easy transforms like cropping and rotating from
> Lisp, too.

Are you talking about using an image spec that we use to display
images, which can already include rotation and resizing?

That would be difficult because the stored image data doesn't have
those transformations applied, unless you're using imagemagick. We'd
have to draw it to a buffer (either on-screen or off) and then read
back that data.

-- 
Alan Third




This bug report was last modified 3 years and 222 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.