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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Lars Ingebrigtsen <larsi@HIDDEN>; dated Fri, 23 Oct 2020 11:19:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 44172 <at> debbugs.gnu.org:


Received: (at 44172) by debbugs.gnu.org; 24 Oct 2020 19:51:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 24 15:51:17 2020
Received: from localhost ([127.0.0.1]:35208 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kWPZN-0002bF-8c
	for submit <at> debbugs.gnu.org; Sat, 24 Oct 2020 15:51:17 -0400
Received: from quimby.gnus.org ([95.216.78.240]:52128)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kWPZL-0002b3-NT
 for 44172 <at> debbugs.gnu.org; Sat, 24 Oct 2020 15:51:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=W4LI347L7i0en+QLk8LP8eflz3+n7c9vopiMCIUR9ow=; b=aUZlWV+hAxa0wpu6NW8ReWdbnq
 pYUpJ6/9Jp6lQ0CD80x6NzjguclqPt9fuY/hSongEvFtXABzFMHH/qt6aEgFK3h10fduYy6q28w/K
 XC9dIl9UGhlNsLfWYaFwBTwlmnIKYS8c7Z+FzUOmsxJCcvEyy7vCGMqL7LLaKQhz5tIk=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kWPZD-0007Xt-95; Sat, 24 Oct 2020 21:51:09 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alan Third <alan@HIDDEN>
Subject: Re: bug#44172: 28.0.50; Exporting image data
References: <87mu0dgpgv.fsf@HIDDEN>
 <20201023162419.GB59267@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEX27tn1797QxrqU
 jImKgX2Ee3hvZ2crJihDOz5STE3////GrS5UAAAAAWJLR0QKaND0VgAAAAd0SU1FB+QKGBMgGAaU
 NTgAAAGDSURBVDjLjZJNboMwEIWHngBu0B+p6wiSqnvMCQBL3VbCiS8Qc4IwbFsJ4dt2xoZgKpDy
 pAR437w3TgRAoDiZFcNa0Z0kPLdJ1j4pSPxTAnEUbYJoIxEuj+KNBQ5s++uq5KHEQ1XRHoA9ED90
 qp0VCbxuCyDbEWTiWAlRnYQQayCKmiT4K8tDQEaZvmWn2qnKsqOYElVRHN6NB1VVZ0VZHfPcJeQh
 6mQtG7ptHC+LPAdyVPqMUqmmljzFgD6U+BrSJzPcmg9FUEpO0YFAKTneZI8ezGoaAmfjpIcAqHoB
 l2sIOHFx/nWdUAS0tdbYtT0DvQU0gQsBrelRh4CabGudtF2AVtYqjeTey/R9hwfBGjohWK4ae1+l
 iE0DQFupGz0Yp+vAwNIDTolABHrX1c/TC2DNiXEB2HLVenqgE8DIJvo/2NCuuRFoumsR0bTLCbTu
 ezDkYI/+sGhH85PSG5qewfpfyBlXNn6z//IJnYuw76oQf+ltK/MLA9N2OC9A0/FtZ/4A7BBH78of
 cLkAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMTAtMjRUMTk6MzI6MjQrMDA6MDBYEf84AAAAJXRF
 WHRkYXRlOm1vZGlmeQAyMDIwLTEwLTI0VDE5OjMyOjI0KzAwOjAwKUxHhAAAAABJRU5ErkJggg==
X-Now-Playing: Contriva's _If you had stayed..._: "after work club"
Date: Sat, 24 Oct 2020 21:51:05 +0200
In-Reply-To: <20201023162419.GB59267@HIDDEN> (Alan Third's
 message of "Fri, 23 Oct 2020 17:24:19 +0100")
Message-ID: <87mu0bcsie.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Alan Third <alan@HIDDEN> writes: > Are you talking about
 using an image spec that we use to display > images, which can already include
 rotation and resizing? Yes. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44172
Cc: 44172 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Third <alan@HIDDEN> writes:

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

Yes.

> 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.

But it's the untransformed data that we'd want here, so that sounds
great to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44172; Package emacs. Full text available.

Message received at 44172 <at> debbugs.gnu.org:


Received: (at 44172) by debbugs.gnu.org; 23 Oct 2020 16:24:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 23 12:24:33 2020
Received: from localhost ([127.0.0.1]:58069 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kVzrl-00070R-8q
	for submit <at> debbugs.gnu.org; Fri, 23 Oct 2020 12:24:33 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:42888)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1kVzri-000708-Eu
 for 44172 <at> debbugs.gnu.org; Fri, 23 Oct 2020 12:24:32 -0400
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@HIDDEN;
 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==
Received: by smtp.mailfence.com with ESMTPA ;
 Fri, 23 Oct 2020 18:24:20 +0200 (CEST)
Received: by breton.holly.idiocy.org (Postfix, from userid 501)
 id 4BF1A202630F06; Fri, 23 Oct 2020 17:24:19 +0100 (BST)
Date: Fri, 23 Oct 2020 17:24:19 +0100
From: Alan Third <alan@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#44172: 28.0.50; Exporting image data
Message-ID: <20201023162419.GB59267@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 Lars Ingebrigtsen <larsi@HIDDEN>, 44172 <at> debbugs.gnu.org
References: <87mu0dgpgv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87mu0dgpgv.fsf@HIDDEN>
X-Spam-Flag: NO
X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED,
 BAYES_00 device=10.2.0.1
X-ContactOffice-Account: com:241649512
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44172
Cc: 44172 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44172; Package emacs. Full text available.

Message received at 44172 <at> debbugs.gnu.org:


Received: (at 44172) by debbugs.gnu.org; 23 Oct 2020 11:50:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 23 07:50:01 2020
Received: from localhost ([127.0.0.1]:56175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kVva4-0005mN-Pc
	for submit <at> debbugs.gnu.org; Fri, 23 Oct 2020 07:50:01 -0400
Received: from quimby.gnus.org ([95.216.78.240]:54576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kVva2-0005m5-Fn
 for 44172 <at> debbugs.gnu.org; Fri, 23 Oct 2020 07:49:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=85d+pYUkVukF5fdroKkLt6XJmceaPCrRVS6wLB5nZqQ=; b=JNZdrP0FCaMO2LgJKgkFOYG1Du
 UFxdZjzGpEJ94/Qx5E3o1FWQAQbrDlAOeuw6H0Vh23vy9EwWua6ekWvcShujE0w9xMLE9KRgoUThv
 LNRV6w35JIdg3m+D+wwSE98CjyAQgPIU6JXf7PKBdsJF+/D1SDbhHG0QTVrs5ZY2Kfug=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kVvZu-0000S8-7s; Fri, 23 Oct 2020 13:49:52 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#44172: 28.0.50; Exporting image data
References: <87mu0dgpgv.fsf@HIDDEN> <83a6wdjhco.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAKlBMVEX18+zo5dvh3dLZ
 1cqmoZbLxrvAu7AvKCFkXVVDPDVJQjqKhXuCfHP///8XYhd7AAAAAWJLR0QN9rRh9QAAAAd0SU1F
 B+QKFwsTGyGg4ywAAAGbSURBVDjLfZSxTsMwEIZtxMZiO30Bp2JjaBKhrh2CqBhpYa4ESAxMMCTp
 XEiLGJHaZkYyRSxsQSxslLfCdtLknKTc4Dj+cv+dz+cgJA0ThKia6AFT/Sje9VodYNwElBRqkkKG
 VMVgcBMQtaQ0KSVQhG5ojhvAPx5GDLIFbPXYDrhK1yZG6ZQxl2PK2hobgKqP9YB2OEy35Q/9K9+/
 GHbKkmrrBvHyNRCP89tKDbsz0U9m4iv8qIOXYCZ68XcVxOIy+BRH67sqCMRzcDxfRNUYB0/9h/Q6
 vU97Zla4tZyEJ+vfyWpkOuC9aBHGqygKOxWwGy7G8Ti8CYnZEhIkiQSpBLpWuJSKgrdlg1Qrmfbf
 pz8TMcpOoDDrfMB42+PyqOQI4lhnrs0tz6EI7w8gYHKNMumB8OHAIQC4fHO0UgoA6qq70Fa7sE7p
 RkpOaNEM2HKKrEjel1kbMBd2Ay273XJhVtDDgx5Zz2TAhjtnTunBQYVxlpWOwWCtMIyhAG0KbsOs
 stPRGqx+1XB+nSGAfwO4nt9zUgfaH9uoiPQHHR1Rs3csTsoAAAAldEVYdGRhdGU6Y3JlYXRlADIw
 MjAtMTAtMjNUMTE6MTk6MjcrMDA6MDBuj4yLAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTEwLTIz
 VDExOjE5OjI3KzAwOjAwH9I0NwAAAABJRU5ErkJggg==
X-Now-Playing: Ossia's _Devil's Dance_: "(untitled)"
Date: Fri, 23 Oct 2020 13:49:49 +0200
In-Reply-To: <83a6wdjhco.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 23 Oct
 2020 14:45:43 +0300")
Message-ID: <87tuulf9gi.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Eli Zaretskii <eliz@HIDDEN> writes: > Doesn't svg.el come
 close enough? Not really -- if you have an image you've cropped, you can
 certainly write it out as .svg, but it'd be huge. Then PPM would be preferable.
 But neither are much good, in general. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44172
Cc: 44172 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Doesn't svg.el come close enough?

Not really -- if you have an image you've cropped, you can certainly
write it out as .svg, but it'd be huge.  Then PPM would be preferable.
But neither are much good, in general.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44172; Package emacs. Full text available.

Message received at 44172 <at> debbugs.gnu.org:


Received: (at 44172) by debbugs.gnu.org; 23 Oct 2020 11:46:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 23 07:46:07 2020
Received: from localhost ([127.0.0.1]:56153 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kVvWJ-0004aI-2S
	for submit <at> debbugs.gnu.org; Fri, 23 Oct 2020 07:46:07 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kVvWH-0004St-35
 for 44172 <at> debbugs.gnu.org; Fri, 23 Oct 2020 07:46:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45219)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kVvWB-0004CB-OH; Fri, 23 Oct 2020 07:45:59 -0400
Received: from [176.228.60.248] (port=2112 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kVvW9-0005aK-NT; Fri, 23 Oct 2020 07:45:59 -0400
Date: Fri, 23 Oct 2020 14:45:43 +0300
Message-Id: <83a6wdjhco.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87mu0dgpgv.fsf@HIDDEN> (message from Lars Ingebrigtsen on Fri, 
 23 Oct 2020 13:18:40 +0200)
Subject: Re: bug#44172: 28.0.50; Exporting image data
References: <87mu0dgpgv.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44172
Cc: 44172 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Fri, 23 Oct 2020 13:18:40 +0200
> 
> 2) Create image files.

Doesn't svg.el come close enough?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44172; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Oct 2020 11:18:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 23 07:18:54 2020
Received: from localhost ([127.0.0.1]:55539 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kVv5x-0000Uu-PW
	for submit <at> debbugs.gnu.org; Fri, 23 Oct 2020 07:18:54 -0400
Received: from lists.gnu.org ([209.51.188.17]:59104)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kVv5u-0000Uk-7J
 for submit <at> debbugs.gnu.org; Fri, 23 Oct 2020 07:18:51 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51368)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <larsi@HIDDEN>) id 1kVv5t-0004lD-WF
 for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2020 07:18:50 -0400
Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:43678)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <larsi@HIDDEN>) id 1kVv5q-00085m-Or
 for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2020 07:18:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:
 Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=hR9BUMSNMB962SYVBYYQQMP4maPj87RtVpRYWxRpKXg=; b=fDptH+IxzQSujDjFeS1FeVE3WF
 LlRAmOiSqMSEXTBYeLc+uehtRYYAgcIA8jINzJsBaXi1bxbsxFH7XjW3sHk6bx0HMN7IzaFAMxzhu
 T1HqceC9E+IDx5Q3ryr35i5p/y9/vihDmp6EguYGpUDJFZkoYJHLTkmu/BOxVr891t4E=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1kVv5l-00009O-O0
 for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2020 13:18:44 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; Exporting image data
X-Now-Playing: Ossia's _Devil's Dance_: "(untitled)"
Date: Fri, 23 Oct 2020 13:18:40 +0200
Message-ID: <87mu0dgpgv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  There's been some discussion off-list about adding simple
 image manipulation functions to Emacs, and there's really only three transforms
 that are in scope for Emacs: Cropping, rotating and resizing. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@HIDDEN;
 helo=quimby.gnus.org
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


There's been some discussion off-list about adding simple image
manipulation functions to Emacs, and there's really only three
transforms that are in scope for Emacs: Cropping, rotating and resizing.

Now, there are packages out there that allow doing this, but they rely
on external programs to actually do the image wrangling.  I wondered
what it would take to make it possible to do this in-Emacs, and I think
we basically have all the needed stuff -- we just need to hook it up and
make it available.

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.

2) Create image files.

But mogrifying images is all well and good, but if we can't save the
data, it's not much use.  Of course we could just save the data as PPM,
but that's not very helpful.  So Emacs needs to be able to write image
files...  which sounds like a big thing, but it isn't really: As long as
we can save .jpeg and .png files, that's fine.

Fortunately, Emacs links with libpng and libjpeg already, so adding a

(encode-image-data TYPE)

function is less work than it would seem.




In GNU Emacs 28.0.50 (build 124, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0)
 of 2020-10-22 built on xo
Repository revision: 954a4decfcc8e41084789516773b22d0adc11d91
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Acknowledgement sent to Lars Ingebrigtsen <larsi@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#44172; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 24 Oct 2020 20:00:02 UTC

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