From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: Image rescaling Date: Mon, 15 Sep 2014 17:12:31 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410794001 13968 80.91.229.3 (15 Sep 2014 15:13:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Sep 2014 15:13:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 15 17:13:14 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XTXxq-0002YM-3r for ged-emacs-devel@m.gmane.org; Mon, 15 Sep 2014 17:13:14 +0200 Original-Received: from localhost ([::1]:60496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTXxp-0005tN-In for ged-emacs-devel@m.gmane.org; Mon, 15 Sep 2014 11:13:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTXxd-0005gQ-J9 for emacs-devel@gnu.org; Mon, 15 Sep 2014 11:13:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTXxX-0002SA-Cr for emacs-devel@gnu.org; Mon, 15 Sep 2014 11:13:01 -0400 Original-Received: from mx2.bahnhof.se ([213.80.101.12]:16122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTXxX-0002S6-1n for emacs-devel@gnu.org; Mon, 15 Sep 2014 11:12:55 -0400 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx2-reinject (Postfix) with ESMTP id 5537940E0A for ; Mon, 15 Sep 2014 17:12:53 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF2) Original-Received: from mf2.bahnhof.se ([127.0.0.1]) by localhost (mf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Tm-xmdoRIHD for ; Mon, 15 Sep 2014 17:12:44 +0200 (CEST) Original-Received: from mta.verona.se (h-235-102.a149.priv.bahnhof.se [85.24.235.102]) by mf2.bahnhof.se (Postfix) with ESMTP id C139594012A for ; Mon, 15 Sep 2014 17:12:44 +0200 (CEST) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id 8BE95519807 for ; Mon, 15 Sep 2014 15:12:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id viMkiyVBQh7C for ; Mon, 15 Sep 2014 17:12:31 +0200 (CEST) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id 4777F51981E for ; Mon, 15 Sep 2014 17:12:31 +0200 (CEST) In-Reply-To: (joakim@verona.se's message of "Mon, 15 Sep 2014 14:55:50 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.80.101.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174325 Archived-At: joakim@verona.se writes: > Lars Magne Ingebrigtsen writes: > >> Most of the image format decoders (jpeg and gif, for instance) do not >> support image rescaling. So shr uses ImageMagick for all its image >> handling. >> >> There are two problems with this: >> >> 1) ImageMagick is crashy. Virtually all Emacs crashes I get happen deep >> in the ImageMagic code. I mean, I don't get a lot of crashes, but they >> happen from time to time, and are pretty annoying. >> >> 2) Some people run Emacs without ImageMagick built in, but usually have >> the other libraries enabled. >> >> So I would propose to add a general image scaling function, and use that >> in all the image handling functions. Without image rescaling, Emacs is >> pretty useless for anything that involves handling images. >> >> Does this sound OK to everybody? >> >> And if so, is there an FSF-copyright-assigned quality image rescaling >> function out there that I could adapt to Emacs so that I don't have to >> write it myself? >"? > > Its a pity ImageMagic is crashy, but I take your word for it, since i > dont experience it myself. > > Maybe something can be extracted from Gimp or Inkscape? > Other than that, implementing a schoolbook image rescaling algorithm > shouldnt be too much work. OpenCV could perhaps be used as well. I have used it for mixing and scaling of videostreams in the past, using affine transformations. I have used GStreamer as well, but I dont know how good that is for still image scaling. Maybe the above libraries are too heavyweight, I'm just throwing the ideas out there. -- Joakim Verona