unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Timo Taipalus <timo@taipalus.cc>
Cc: 47095@debbugs.gnu.org
Subject: bug#47095: [PATCH] Add support for image mirroring (Bug#47095)
Date: Sun, 2 Jan 2022 14:54:52 +0000	[thread overview]
Message-ID: <YdG8vH7TsXz7/+w1@idiocy.org> (raw)
In-Reply-To: <3b23f6a58f935098122e3bbf21e0f59c@taipalus.cc>

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





  reply	other threads:[~2022-01-02 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 10:34 bug#47095: 27.1; Feature request: mirror image display ynyaaa
2021-12-27  8:36 ` bug#47095: [PATCH] Add support for image mirroring (Bug#47095) Timo Taipalus
2021-12-28  1:01   ` bug#47095: 27.1; Feature request: mirror image display Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-28  9:54     ` Timo Taipalus
2021-12-28 10:07       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-28 11:22   ` bug#47095: [PATCH] Add support for image mirroring (Bug#47095) Alan Third
2021-12-28 18:09     ` bug#47095: [External] : " Drew Adams
2021-12-29  9:10     ` Timo Taipalus
2022-01-02 14:54       ` Alan Third [this message]
2022-01-04 10:25         ` Alan Third
2022-01-05 16:14           ` Lars Ingebrigtsen
2022-01-07 17:00         ` Timo Taipalus
2022-06-24 12:45           ` bug#47095: 27.1; Feature request: mirror image display Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YdG8vH7TsXz7/+w1@idiocy.org \
    --to=alan@idiocy.org \
    --cc=47095@debbugs.gnu.org \
    --cc=timo@taipalus.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).