Global webcam orientation settings not applied to telegram plugin?

Camera model
Raspberry Pi Cam Module v2 (imx219, 3280x2464 max. resolution)

What is the problem?
I am using the telegram notifications plugin to get updates via telegram. But the pictures are not oriented the same way as in the webinterface.
In the control tab all is displayed/oriented like I configured it (horizontally and vertically flipped). But when I get a telegram notification with a picture none of those configurations are applied and it is rotated 180° clockwise. I checked the webcam page and found out that when I click "test stream url" the same happens... The picture in the result frame is also not oriented as configured (rotate 180°) and therefore standing on its head. Same applies to snapshot test...
Noticed this behavior since the switch to OctoPrint 1.4.1.

What did you already try to solve it?
disabling/re-enabling webcam, different flip configurations, tinkered with octopi.txt settings for raspi camera (resolution), also tried this fix from the telegram notification plugin with no success

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
dmesg.log (20.3 KB) syslog.log (659.5 KB) webcamd.log (980.8 KB)

Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint Version 1.4.2
OctoPi Version 0.15.1, running on Raspberry Pi 3 Model B Rev 1.2

This is by design; The orientation you set in OctoPrint is just how OctoPrint handles the stream; it does not actually alter the stream.

The stream is not created by OctoPrint; it could be created by any program, but in most cases (eg OctoPi), it is created by a 3rd party application called mjpegstreamer. OctoPrint can not rotate the stream/snapshot, it can only display it rotated. Other applications would need to do their own rotation.

1 Like

Ok, thank you for the pointing that out (after initially setting it up years ago it ran smoothly, so I did not remember seeing this :innocent:).

With that info I went to the octoprint-telegram git again and found this open issue: Pictures ignore horizontal and vertical flip

For a quick fix (in my case) I needed to edit the file on lines 1407 and 1409 and remove the negation from the if-clause (the not).

if flipH or flipV or rotate:
                        image =
                        #if not flipH: -> previously
                        if flipH:
                                image = image.transpose(Image.FLIP_LEFT_RIGHT)
                        #if not flipV: -> previously
                        if flipV:
                                image = image.transpose(Image.FLIP_TOP_BOTTOM)

a comment from rlogiacco in the issue thread implys that this could differ from other user installations (since in the original post it was suggested to add the negation).

Thanks again for the quick help!