From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: image-transform.el and image-mode.el rewrite Date: Fri, 19 Jul 2013 13:52:16 +0200 Message-ID: <85vc463gy7.fsf@inode.at> References: <87a9lp8uxk.fsf@gmail.com> <87ppuk6qqb.fsf@gmail.com> <87vc49y793.fsf@gmail.com> <87ppuhxk04.fsf@gmail.com> <87ehavihbp.fsf_-_@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374234749 2117 80.91.229.3 (19 Jul 2013 11:52:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Jul 2013 11:52:29 +0000 (UTC) Cc: Stefan Monnier , joakim@verona.se, emacs-devel@gnu.org To: Vitalie Spinu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 19 13:52:29 2013 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 1V09Eb-0007Pm-1H for ged-emacs-devel@m.gmane.org; Fri, 19 Jul 2013 13:52:29 +0200 Original-Received: from localhost ([::1]:50631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V09Ea-0001xT-Ky for ged-emacs-devel@m.gmane.org; Fri, 19 Jul 2013 07:52:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V09EW-0001xG-Cq for emacs-devel@gnu.org; Fri, 19 Jul 2013 07:52:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V09EV-0003Yp-6a for emacs-devel@gnu.org; Fri, 19 Jul 2013 07:52:24 -0400 Original-Received: from mx07.lb01.inode.at ([62.99.145.7]:23206 helo=mx.inode.at) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V09EU-0003XK-Vx for emacs-devel@gnu.org; Fri, 19 Jul 2013 07:52:23 -0400 Original-Received: from [91.119.88.127] (port=9805 helo=localhost) by smartmx-07.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1V09ER-0004hL-D6; Fri, 19 Jul 2013 13:52:19 +0200 Original-Received: from wolfgang by localhost with local (Exim 4.80.1) (envelope-from ) id 1V09EO-0000PR-5s; Fri, 19 Jul 2013 13:52:16 +0200 Mail-Followup-To: Vitalie Spinu , Stefan Monnier , joakim@verona.se, emacs-devel@gnu.org In-Reply-To: <87ehavihbp.fsf_-_@gmail.com> (Vitalie Spinu's message of "Fri, 19 Jul 2013 01:22:50 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 62.99.145.7 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:162018 Archived-At: On Fri, Jul 19 2013, Vitalie Spinu wrote: > +;; these are 3, virtuly unchenged, objects from old image-mode.el > +;; fixme: see the author Hi! > + ;; on GNU Emacs 24.3.50.4 (i686-pc-linux-gnu, X toolkit, Xaw > + ;; scroll bars) of 2013-07-16, image width is slightly > + ;; truncated, ~6px, so the below mambo math for .5px > + ;; adjustment is pretty useless. The rotation stuff is written in such a a way that fit-width (resp. fit-height) produces a rotated image whose bounding-box, with the roundings applied by ImageMagick, viz. > +;; geometry.x = (ssize_t) floor(min.x-0.5); > +;; geometry.y = (ssize_t) floor(min.y-0.5); > +;; geometry.width=(size_t) ceil(max.x-geometry.x+0.5); > +;; geometry.height=(size_t) ceil(max.y-geometry.y+0.5); has _exactly_ the desired pixel width (resp. height), and there's an assertion in image-mode which tests this. So, except for this > +(defvar image--right-angle-fudge 0.0001 > + "Snap distance to a multiple of a right angle. > +There's no deep theory behind the default value, it should just > +be somewhat larger than ImageMagick's MagickEpsilon.") everything is exact math without fudge factors. In particular, thing's won't be quite correct if you do > + ;; VS[16-07-2013]: returning (w . h) is unnecessary, it > + ;; distorts the image and processing becomes very slow Wolfgang