Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed image rotation, fixed 2 typos #287

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

f4nu
Copy link
Contributor

@f4nu f4nu commented Sep 4, 2020

Since my fix on PR #242 mirrored images for others and it's been reverted in #268, my images are now being wrongly flipped again.

I searched trough PIL.Image documentation and I found that rotate() rotates CCW, as OctoPrint states in the options:

image

image
The documentation states that rotate() and transpose() operations are interoperable:

transpose(ROTATE) operations can also be performed identically with :py:meth:~PIL.Image.Image.rotate operations

so the rotation needed to match OctoPrint's behaviour is Image.ROTATE_90, not Image.ROTATE_270.

This explains the correct behaviour I got with my old PR #242 with the rotation + vertical and horizontal flipping.

With Image.ROTATE_90 I'm now getting the same image while rotating and flipping in any combination

image
image
image
image

@giloser
Copy link
Collaborator

giloser commented Feb 18, 2021

Hi is this still needed?
if yes could we think of something like an option in the plugin to force it to 270 instead of 90 when it's selected.
So we avoid that for some it work and for other it doesn't.

@f4nu
Copy link
Contributor Author

f4nu commented Feb 18, 2021

I'm currently on 1.6.3 and my webcam is still flipped. I also thought of the option but I couldn't figure out how to pass the arguments from the options to that part of the script :(
Is it working as intended to you though? Is the image you get from the stream flipped/rotated the same way on Telegram?

@giloser
Copy link
Collaborator

giloser commented Feb 19, 2021

I don't have the problem but I flipped my images from the script so I don't use the option to flip it.

I'll add an option to flip on 90 or 270 and I hope this will fix the problem for every one.
Will be on the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants