BrianHepler / MMM-Selfieshot

Taking a Selfie with USB cam on MagicMirror.
MIT License
8 stars 6 forks source link

How to rotate preview #13

Closed J0han3s closed 1 year ago

J0han3s commented 2 years ago

My preview needs to be rotated by 90 degrees because I have my monitor in portrait mode.

Is this possible?

Thanks

hclausd commented 2 years ago

Hello Brian, I was wondering, if there is the possibility to add a rotation option, as asked above. node-webcam.js has a rotation option but my programming skills are too insufficient to figure out how to implement such a rotation on the level of the preview. It would be awesome, if you could help! Best, Hendrik

BrianHepler commented 2 years ago

I'll look into it.

BrianHepler commented 2 years ago

Okay, the rotation feature has been added. If you would please try it out on the rotate-preview branch, I would appreciate it. It works for me, but I would like some testing before I merge it into the main branch.

hclausd commented 2 years ago

Thanks for the implementation and sorry for the late reply/testing, Brian! I tested the rotation option from your newest version (1.0.4) and it works fine with my Raspi 3B+ and Raspi 2.1 camera.

One thing I have been wondering: Could you implement two rotation options: 1) for the countdown and 2) the photo preview? In my mirrors portrait orientation the countdown orientation was good, but only the photo preview was wrong by 90°.

Best, Hendrik

BrianHepler commented 2 years ago

Sure, that should be relatively easy. I'll get on that.

BrianHepler commented 1 year ago

I separated the rotation feature into two variables: rotateCountdown and rotatePreview. You can test them out by checking out the more-rotation branch. Give 'em a go and let me know if they work for you.

hclausd commented 1 year ago

Hey Brian, thanks for this adaptation. It tested it (went through all possible orientations) and it works great! Should be good to be integrated into the main branch :) Best, Hendrik