From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Image-conversion shims Date: Sat, 28 Sep 2019 22:06:29 +0200 Message-ID: <87v9tctcca.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="184194"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 28 22:07:10 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEIzl-000lnb-Ur for ged-emacs-devel@m.gmane.org; Sat, 28 Sep 2019 22:07:10 +0200 Original-Received: from localhost ([::1]:34802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEIzk-0005cq-Gx for ged-emacs-devel@m.gmane.org; Sat, 28 Sep 2019 16:07:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51323) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEIzE-0005AA-Ay for emacs-devel@gnu.org; Sat, 28 Sep 2019 16:06:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEIzC-0001D2-K4 for emacs-devel@gnu.org; Sat, 28 Sep 2019 16:06:36 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:58530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iEIzC-0001B6-DQ for emacs-devel@gnu.org; Sat, 28 Sep 2019 16:06:34 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEIz8-0006T8-7S for emacs-devel@gnu.org; Sat, 28 Sep 2019 22:06:32 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240373 Archived-At: I suggested this in an unrelated bug report, but nobody probably saw it there, so I'm bringing it up here again: Emacs has approximate feature parity for the major image formats (JPEG, PNG, etc) now with ImageMagick-enabled Emacs versions. I think our long-term plan is to obsolete the ImageMagick support completely, because ImageMagick has some security issues. However, the only way to support more obscure image formats (like BMP or WebP) is currently to build with ImageMagick support, so it seems likely to me that distributions are going to continue doing that. So I wonder whether a way to speed up the transition to an ImageMagick-less future would be to have a small package that would convert "transparently" from formats we don't understand to formats we do understand. The only likely external conversion program is, unfortunately, "convert" from ImageMagick, so there are still security implications, and a shim like that isn't something we could have switched on by default. However, we would be able to say to users who need to handle some BMP images "set `use-external-image-formats' to t" instead of "build with ImageMagick", and that would be a win, I think. (Because Emacs would at least segfault less.) If that variable is t, and we don't have support for whatever image format the user is trying to display, then `create-image' would use the conversion package to basically run "convert" on the file first. And "convert -list format/magic" tell us what formats it supports, so it could all be made to work automagically. Thoughts? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no