From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Timo Taipalus Newsgroups: gmane.emacs.bugs Subject: bug#47095: [PATCH] Add support for image mirroring (Bug#47095) Date: Mon, 27 Dec 2021 10:36:43 +0200 Message-ID: <9d31c48598c3fc1cd6a90a1845f518cb@taipalus.cc> References: <86a6r8hd8q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_7f12bd78817f0f6c64c1f0b60a593a4d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18898"; mail-complaints-to="usenet@ciao.gmane.io" To: 47095@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 27 18:08:26 2021 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 1n1tU2-0004g4-5K for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Dec 2021 18:08:26 +0100 Original-Received: from localhost ([::1]:42692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1tTz-0002s6-I8 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Dec 2021 12:08:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1tSg-0002pe-7o for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2021 12:07:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1tSf-0002Kc-UN for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2021 12:07:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n1tSf-0001fx-Jp for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2021 12:07:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <86a6r8hd8q.fsf@gmail.com> Resent-From: Timo Taipalus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Dec 2021 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47095 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16406247766340 (code B ref -1); Mon, 27 Dec 2021 17:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Dec 2021 17:06:16 +0000 Original-Received: from localhost ([127.0.0.1]:44165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1tRt-0001e5-OS for submit@debbugs.gnu.org; Mon, 27 Dec 2021 12:06:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:45898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1lV0-00044f-QQ for submit@debbugs.gnu.org; Mon, 27 Dec 2021 03:36:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1lV0-0000JX-Jo for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2021 03:36:54 -0500 Original-Received: from mail.kapsi.fi ([91.232.154.25]:59963) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1lUx-0007OT-HX for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2021 03:36:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Type:Message-ID:Subject:To:From:Date:MIME-Version: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pH8IHNPp7vVnh+WAXP1YCvb3J1v4qX6IzYIaSWS0AK0=; b=EFLyYibxKDNQGUTGWdPVb5MeVa LO6K8w66tWuHWxZLmLi/pOZ9XPQzjTKeWf0/s+zqSPbmhWkCiPGko6kWx62yXj9hf9hM0rNjqD1OZ 3KnyOwvG9EpRYIGnzzAv+j4+PLnO+x+/f6vDOV631rJ1jscYzI32ZzYa2qeeMA2cD9mH8sGHBPvne sRKTVLuFOY2RlZWGExlB3XzVPwPlkfKmKffRyYq/TC2w9aFGVfTBhts19qj1N71NKIVNFSr1M7g+T KBiYWE9fsw/TDrpCNvfsjasjwX4GVZxos2J1dSEx67DjFAVz9Ct9vAbUKZsRtJZyA8//oHD5+k7Dy S3J+eufQ==; Original-Received: from webng-gw.kapsi.fi ([91.232.154.200] helo=roundcube.kapsi.fi) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1n1lUr-0003wM-97 for bug-gnu-emacs@gnu.org; Mon, 27 Dec 2021 10:36:45 +0200 X-Sender: timo@taipalus.cc X-SA-Exim-Connect-IP: 91.232.154.200 X-SA-Exim-Mail-From: timo@taipalus.cc X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Received-SPF: pass client-ip=91.232.154.25; envelope-from=tta@kapsi.fi; helo=mail.kapsi.fi X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 27 Dec 2021 12:06:12 -0500 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:223201 Archived-At: --=_7f12bd78817f0f6c64c1f0b60a593a4d Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed It seems image-mode does not have capability for image mirroring, so here's a patch for it. Tested NS (macOS) and XRender/Cairo implementations. As it is, it has no effect if ImageMagick is enabled. I chose 'h' as the action key because 'm' and 'f' were reserved, and 'h' is easy to memorize ("horizontal"). --=_7f12bd78817f0f6c64c1f0b60a593a4d Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Add-support-for-image-mirroring-Bug-47095.patch Content-Disposition: attachment; filename=0001-Add-support-for-image-mirroring-Bug-47095.patch; size=4255 RnJvbSAzZTY3NzM0Y2ViMWY3MTBhNjAzOTgyNGI4YzIyNGI5N2NkZWJjZDQ0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBUaW1vIDx0aW1vQHRhaXBhbHVzLmNjPgpEYXRlOiBTYXQsIDI1 IERlYyAyMDIxIDE1OjM4OjIwICswMjAwClN1YmplY3Q6IFtQQVRDSF0gQWRkIHN1cHBvcnQgZm9y IGltYWdlIG1pcnJvcmluZyAoQnVnIzQ3MDk1KQo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