From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.devel Subject: Re: Linking to ImageMagick by default Date: Wed, 5 Dec 2018 13:27:01 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000675ce9057c4a89af" X-Trace: blaine.gmane.org 1544035177 28664 195.159.176.226 (5 Dec 2018 18:39:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2018 18:39:37 +0000 (UTC) Cc: larsi@gnus.org, emacs-devel@gnu.org To: rgm@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 05 19:39:33 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUc56-0007M7-IS for ged-emacs-devel@m.gmane.org; Wed, 05 Dec 2018 19:39:32 +0100 Original-Received: from localhost ([::1]:36214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUc7C-0005rH-QL for ged-emacs-devel@m.gmane.org; Wed, 05 Dec 2018 13:41:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUc3y-0000V8-W3 for emacs-devel@gnu.org; Wed, 05 Dec 2018 13:38:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUbte-0001F4-VD for emacs-devel@gnu.org; Wed, 05 Dec 2018 13:27:44 -0500 Original-Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]:39773) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUbtc-0000uL-Vo for emacs-devel@gnu.org; Wed, 05 Dec 2018 13:27:41 -0500 Original-Received: by mail-oi1-x229.google.com with SMTP id i6so18389074oia.6 for ; Wed, 05 Dec 2018 10:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bFK+VK4u/oDXDrLHJut2qEhWQNmrNNCc8LjNMJsXCeM=; b=W22krmFqleQXDjUjitwmdDz8Vvo3UPoucKAVJefTiHEoaP+IQFUkbS/cABIXFBdMM6 IA5GCoNDpt2M5mHJDLi6hpaxDhbVAwG/yUCUpWfBWmHzkzRIKgNpkqXF/lkuREt/EzmF eBpbx4K38ItowmNKllTR/g+p/9ck1FvrYUrA4V5hivqn1aVOjCdxpWKs8v3085dhvJuM ek0XwXCBev+YobeA1Dd0KDclyoSoH0sELi5xnyuWe4cMQx9bSjw9tktMH0hrIAK5C10A WeQY+fRAx3So1+i+MrFKzHRDID3JwHkfnuX97jmL5lT/mAviOXXZtxeyL0f8L6X4T+WP IQYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bFK+VK4u/oDXDrLHJut2qEhWQNmrNNCc8LjNMJsXCeM=; b=dtPs51ijrle/ngvQfqkWaMqIJfwmLJQgweKIAyp/Q3EGPYcVLa4ZXKD0RYhQi7L0K3 WF1JrpDKQZwYTZoC02ZPZljiYLJTikAaDmhP5P0PUwowl+yuh9OELPzrFywMduHvdVL5 mAHKXIpKmIy5JHUEvXJUyAdiJzAijnVH/EeJVyJv7cpPp13FPlgViAvICkAOsigovr4w M0L+RGfYGB2VEKlp5VmqqS5KAZgIzVlQtWU6G60TzMGPvFnp5Addy2oEobxYwKYu6XvW hOa/JDoxJYRP2MrRJpxboo87rKAbNxMrpPsNHO+L9tNbFS7+ynSZCl3DcGZKRoPqaPUP XAKg== X-Gm-Message-State: AA+aEWYerlqme92aC3K3XpT2bqMZHqLtaoo9JJSWfG1MMPdYTAT5v2Al U9tK8mzReioONgmQRpPNGQJjuFNtwWRzWuUaAT5yeg== X-Google-Smtp-Source: AFSGD/WXhhkMD+2I9Cvl7umptqvTXpkPfoKhvmeF61/GWMt5nlQGTbCyRI1OyvbiZDSXSf3VtCI8jLJxhRvlY41MZV8= X-Received: by 2002:aca:d00a:: with SMTP id h10mr14862015oig.316.1544034458204; Wed, 05 Dec 2018 10:27:38 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:231638 Archived-At: --000000000000675ce9057c4a89af Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 5, 2018 at 12:26 PM Glenn Morris wrote: > Lars Ingebrigtsen wrote: > > > Without image scaling, modes that display images become pretty > > worthless. > > I think that is an issue that will vary from person to person. > This is ... mostly true, I guess, but I'm certainly in the "scaling is a requirement" bucket. > > I think the long term solution here is to implement image scaling in > > Emacs (probably not very hard) and then drop ImageMagick-by-default > > after that's been done. > Image scaling is ... a big tent, and depending on your tolerance for errors, and preference for which artifacts show up, can be reasonably complex to implement. For example, the default with ImageMagick is adaptive; see https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/resize.c#= L2344 To get the current behaviour you would need to implement the Mitchell-Netravali Cubic filter [1] and also the Lanczos 3-lobe Sinc-Sinc filter; those are not necessarily the best choices. For those, see the discussion pages for ImageMagick on the subject: * [1] https://www.cs.utexas.edu/~fussell/courses/cs384g-fall2013/lectures/mitchel= l/Mitchell.pdf * http://www.imagemagick.org/Usage/resize/#techniques * http://www.imagemagick.org/Usage/filter/nicolas/ The last gives a good explanation of the trade-offs, as does the first. Personally, I would much rather buy than build that sort of image filtering logic. :) Do you have an opinion of GraphicsMagick? It claims to be more stable and secure than ImageMagick. > It isn't wildly better in terms of security than ImageMagick is; for example, compare: https://security-tracker.debian.org/tracker/source-package/imagemagick https://security-tracker.debian.org/tracker/source-package/graphicsmagick The most recommended "I want an imaging library with an extremely broad set of features, supporting most image types" option seems to be libvips, which provides similar features to ImageMagick, but has a better focus on security =E2=80=93 especially recently =E2=80=93 and a less troubled histor= y. Remember that popularity is a big driver of security vulnerability identification though, and IM is "the" solution in many popular web languages: https://security-tracker.debian.org/tracker/source-package/vips I guess that someone who knows the Emacs ImageMagick code could port it > to GraphicsMagick fairly easily. (I don't, and didn't, bug#14358). > Yes, that should be reasonably easy. The compatibility of the API is fairly good, in my past experience. --000000000000675ce9057c4a89af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 5, 2018 at 12:26= PM Glenn Morris <rgm@gnu.org> wro= te:
Lars Ingebri= gtsen wrote:

> Without image scaling, modes that display images become pretty
> worthless.

I think that is an issue that will vary from person to person.

This is ... mostly true, I guess, but I'm certa= inly in the "scaling is a requirement" bucket.
=C2=A0
> I think the long term solution here is to implement image scaling in > Emacs (probably not very hard) and then drop ImageMagick-by-default > after that's been done.

Image = scaling is ... a big tent, and depending on your tolerance for errors, and = preference for which artifacts show up, can be reasonably complex to implem= ent.=C2=A0 For example, the default with ImageMagick is adaptive; see=C2=A0= https://github.com/ImageMagick/ImageMagick/blob/master/Ma= gickCore/resize.c#L2344

To get the current beh= aviour you would need to implement the Mitchell-Netravali Cubic filter [1] = and also the Lanczos 3-lobe Sinc-Sinc filter; those are not necessarily the= best choices.=C2=A0 For those, see the discussion pages for ImageMagick on= the subject:

=

The last gives a good explanation of the trade-offs, as= does the first.=C2=A0 Personally, I would much rather buy than build that = sort of image filtering logic. :)

Do you have an opinion of GraphicsMagick?=C2= =A0
It claims to be more stable and secure than ImageMagick.

It isn't wildly better in terms of security than Imag= eMagick is; for example, compare:

The most recommended "I want an im= aging library with an extremely broad set of features, supporting most imag= e types" option seems to be libvips, which provides similar features t= o ImageMagick, but has a better focus on security =E2=80=93 especially rece= ntly =E2=80=93 and a less troubled history.=C2=A0 Remember that popularity = is a big driver of security vulnerability identification though, and IM is = "the" solution in many popular web languages:

I guess that s= omeone who knows the Emacs ImageMagick code could port it
to GraphicsMagick fairly easily. (I don't, and didn't, bug#14358).<= br>

Yes, that should be reasonably easy.=C2= =A0 The compatibility of the API is fairly good, in my past experience.
--000000000000675ce9057c4a89af--