From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#44172: 28.0.50; Exporting image data Date: Fri, 23 Oct 2020 17:24:19 +0100 Message-ID: <20201023162419.GB59267@breton.holly.idiocy.org> References: <87mu0dgpgv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25255"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44172@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 23 18:43:26 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kW0A1-0006SA-JG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 18:43:25 +0200 Original-Received: from localhost ([::1]:59094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kW0A0-0006oG-J3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 12:43:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVzsE-0008Ow-QH for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 12:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVzsE-0000ca-DU for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 12:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVzsE-00071F-8S for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Oct 2020 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44172 X-GNU-PR-Package: emacs Original-Received: via spool by 44172-submit@debbugs.gnu.org id=B44172.160347027326939 (code B ref 44172); Fri, 23 Oct 2020 16:25:02 +0000 Original-Received: (at 44172) by debbugs.gnu.org; 23 Oct 2020 16:24:33 +0000 Original-Received: from localhost ([127.0.0.1]:58069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVzrl-00070R-8q for submit@debbugs.gnu.org; Fri, 23 Oct 2020 12:24:33 -0400 Original-Received: from wilbur.contactoffice.com ([212.3.242.68]:42888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVzri-000708-Eu for 44172@debbugs.gnu.org; Fri, 23 Oct 2020 12:24:32 -0400 Original-Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id EAFC960E; Fri, 23 Oct 2020 18:24:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1603470263; s=20200222-6h9o; d=idiocy.org; i=alan@idiocy.org; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:In-Reply-To; l=1225; bh=HtI0ALNeSXavXGmpY3GwbQAD36HxqtO2iYXJ/8gYBF0=; b=W9GVi3tqMOubMWGqMVLoIhFmnbkY4ax5BvauLxayQoPF1mk/9ygLkF8SXr0AGmh2 adG1GMBfE11VQWgsEyyFPduNaHdNZxsVVz25JS+TneX2XARJN5c1VRMREuYTUL7hjX5 WP8GF2CE0BltoicHS9DY2qxkhWa1Q5XO1Bx91qZ0OH4QqXXYv3MIepJ45uBbiI+1X9a JzzXnhJ92ByKNVEpsFshE4r1vq5M4asQCu1dm1ryUPTA1o2GMubwvBlhfcT+zEUi8r8 rwVq46g8Nyfn8hd+VJQmhdBKuglo/XYU7m9nlHga/QNNoNNLQJkcUr/A8R/gNySKQX4 kO7kiFmMGw== Original-Received: by smtp.mailfence.com with ESMTPA ; Fri, 23 Oct 2020 18:24:20 +0200 (CEST) Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 4BF1A202630F06; Fri, 23 Oct 2020 17:24:19 +0100 (BST) Mail-Followup-To: Alan Third , Lars Ingebrigtsen , 44172@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <87mu0dgpgv.fsf@gnus.org> X-ContactOffice-Account: com:241649512 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191383 Archived-At: 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