Read the statement by Michael Teeuw here.
MMM-SelfieShot: Rotating camera
-
Thanks for your reply! I should maybe clarify:
- The camera chip is mounted 90° rotated, so that I can make use of the maximum resolution of the camera chip in portrait mode.
- The post-selfie view should ideally be rotated in the same direction as the camera (90° clockwise or counter-clockwise). Both is possible because I can 3D-print a suitable casing in both directions if necessary :-)
- Rotating the picture file after shooting is not necessary. I do it manually or with another program.
-
@hclaus
So what you need is just displaying picture on mm screen with 90 CW/CCW rotation, I think it could be done with CSS only. I’ll test and show you how to do in a while. (I have dinner now ;) ) -
@hclaus
custom.css#SELFIE .result { width: auto; height: auto; aspect-ratio: 1 / 1; } @media (min-aspect-ratio: 1 / 1) { /* Horizontal Screen */ #SELFIE .result { left: calc((100vw - 90vh) / 2); transform: rotate(90deg); width: 90vh; top: 0; } } @media (max-aspect-ratio: 1 / 1) { /* Vertical Screen */ #SELFIE .result { top: calc((100vh - 90vw) / 2); transform: rotate(90deg); height: 90vw; left: 0; } }
You can adjust some values for your purpose.
-
-
@sdetweil
Yes, It works. Guess it. :) -
@MMRIZE hm… on my 2560wx1080h, top is -612
on my 3840wx2160h, top is -648
((12160) -(.93840))/2 -
@sdetweil
It would be rotated.2560w x 1080h
that is horizontal resolution, so by media rule; below will be adopted;left: calc((100vw - 90vh) / 2); /* (2560 - 972) / 2 = 794 */ transform: rotate(90deg); width: 90vh; /* 972 */ height: (auto) /* 972, by aspect-ratio: 1 / 1; */ top: 0;
-
@MMRIZE ok, got it…
-
@hclaus
Anyway, this is a universal solution, because I don’t know your screen resolution, direction, background padding/margin, wanted photo size, etc.
With specific conditions, it would be deadly simpler.