From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#47095: [PATCH] Add support for image mirroring (Bug#47095) Date: Sun, 2 Jan 2022 14:54:52 +0000 Message-ID: References: <86a6r8hd8q.fsf@gmail.com> <9d31c48598c3fc1cd6a90a1845f518cb@taipalus.cc> <3b23f6a58f935098122e3bbf21e0f59c@taipalus.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15492"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47095@debbugs.gnu.org To: Timo Taipalus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 02 15:56:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n42HO-0003pO-Jx for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Jan 2022 15:56:14 +0100 Original-Received: from localhost ([::1]:53364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n42HN-0005rv-EW for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Jan 2022 09:56:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n42HC-0005ov-P6 for bug-gnu-emacs@gnu.org; Sun, 02 Jan 2022 09:56:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n42HC-0000iC-Fj for bug-gnu-emacs@gnu.org; Sun, 02 Jan 2022 09:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n42HC-0005cK-Cf for bug-gnu-emacs@gnu.org; Sun, 02 Jan 2022 09:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Jan 2022 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47095 X-GNU-PR-Package: emacs Original-Received: via spool by 47095-submit@debbugs.gnu.org id=B47095.164113530419950 (code B ref 47095); Sun, 02 Jan 2022 14:56:02 +0000 Original-Received: (at 47095) by debbugs.gnu.org; 2 Jan 2022 14:55:04 +0000 Original-Received: from localhost ([127.0.0.1]:60123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n42GF-0005Bi-Po for submit@debbugs.gnu.org; Sun, 02 Jan 2022 09:55:04 -0500 Original-Received: from outbound.soverin.net ([116.202.126.228]:55075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n42GE-0005B1-0d for 47095@debbugs.gnu.org; Sun, 02 Jan 2022 09:55:03 -0500 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 80ED685C; Sun, 2 Jan 2022 14:54:55 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1641135295; bh=nSlJBfzV7/w+zVxrPG2RjPxpp59Je5xJmGDr58CRHGg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C0I+MRkujluqDGzksRI1quLiswGiWW8LwtGC0k1oJl2/7YOYgCQGalOvE/9A0GSNN HqNuonPRziepfBjMC2rAiGxNwM6Frv+XB6irtfkyFnEFBMJh41HrZraRlX0QUW6YyB AZ4zdrn69MvWC6nJU2Nlr55AnsssJ1QwNw3Sy2AgygLVCUZF/wrkMvDE4VljY4PtVR xzoYN0uC+a9O7a/O2n1gGrh13i8W9dIIYe7K/MZV7jBh7ktA1OqAQBJcGWS7LcmiQB 7a2mukvZd0HW/3bRCOvs45JdRCDJhU+DWk+3+xOzzUtR1roVLlzMw//S5phhxIk0Uo W9kRLxPckFVsA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2) (envelope-from ) id 1n42G4-002JO4-Vk; Sun, 02 Jan 2022 14:54:52 +0000 Mail-Followup-To: Alan Third , Timo Taipalus , 47095@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <3b23f6a58f935098122e3bbf21e0f59c@taipalus.cc> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223545 Archived-At: On Wed, Dec 29, 2021 at 11:10:03AM +0200, Timo Taipalus wrote: > On 28.12.2021 13:22, Alan Third wrote: > > Is it possible to do the mirroring before the rotation instead of as > > part of it? I feel like it would make the code a little clearer, > > although I suspect you're doing it in the rotation to reduce the > > number of calculations? Would it be possible to have both horizontal > > and vertical mirroring? > > As said elsewhere, "r" is reserved for rotation. :) > > I added an elisp function to do a vertical flip. Also I renamed the > procedure flipping because that's what GIMP calls it. Attached is a > revised patch to replace the previous one. > > As for the C code, I agree it adds some complexity to the transform > function, but this is probably the fastest way to achieve it. > > Flipping before rotation would lead to strange results when the image > has been rotated 90/270 degrees. Then the flip commands seem reversed > – horizontal flip actually flips vertically and vice versa. This is > because the transform function always rotates the initial image, > which is what would be flipped. That's actually what I'd expect to happen, tbh. :) There's a bit of a problem with Emacs image manipulation, IMO, in that the transform order is baked in, so we end up with strange situations like when you set max-width, then rotate 90 degrees so now max-width affects the height of the image instead of the width. So whatever, I don't feel very strongly about it. One more thing: do you feel up to adding a note in the manual about this new property? It should go in doc/lispref/display.texi. Look for rotation. > Hopefully someone can test this patch on Windows. Indeed. If nobody tests it in a week or so we can try just pushing it to master and hope someone reports a bug if it doesn't work. -- Alan Third