Feature description
Complementary to the previous request (already implemented) [Rotate a camera image by 180° - [Archive] Feature request - Gladys Assistant Community](https://community.gladysassistant.com/t/pouvoir-tourner-une-image-de-camera-a-
Lokkye
June 28, 2023, 12:55pm
2
I know there wasn’t a vote but I wanted to do a little something.
Here’s what I did :
@lmilcent : Does this match your request?
4 Likes
Lokkye
June 29, 2023, 7:31am
3
2 Likes
Thanks for the PR
I have some feedback — on my machine the PR doesn’t work because of a type conversion bug
master ← callemand:RotationCamera
ouvert 01:01PM - 28 Jun 23 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [x] If your changes affects code, did your write the tests?
- [x] Are tests passing? (`npm test` on both front/server)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new features/services, did you run integration comparator? (`npm run compare-translations` on front)
- [x] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to [the community](https://community.gladysassistant.com/) for testing before merging.
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Add possibility to rotate camera at 90°, 180° and 270°
<img width="1040" alt="Screenshot 2023-06-28 at 14 54 01" src="https://github.com/GladysAssistant/Gladys/assets/11317212/7260c569-4cff-4693-8b2a-8ab33ada49dd">
<img width="383" alt="Screenshot 2023-06-28 at 14 52 04" src="https://github.com/GladysAssistant/Gladys/assets/11317212/167e88be-71eb-4d17-ac85-7366408ae22b">
<img width="382" alt="Screenshot 2023-06-28 at 14 51 57" src="https://github.com/GladysAssistant/Gladys/assets/11317212/0e6714d1-19bd-4002-a918-7bc91a7999fa">
Absolutely! Depending on how I position my Raspberry Pi Camera, I need it to return to 90°.
Thank you for your work!
Ok, I’ve retested and it works now!
However, I have a small issue: since the image is rotated, the final image size is larger than the maximum image size we allow (100KB instead of max 75KB)
I have this error:
2023-07-03T10:53:51+0200 <warn> poll.js:14 (RtspCameraHandler.poll) Unable to poll camera
2023-07-03T10:53:51+0200 <debug> poll.js:15 (RtspCameraHandler.poll) BadParameters [Error]: Image is too big
at Camera.setImage (/Users/pierregilles/code/gladys/server/lib/device/camera/camera.setImage.js:18:11)
at RtspCameraHandler.poll (/Users/pierregilles/code/gladys/server/services/rtsp-camera/lib/poll.js:12:37)
at DeviceManager.poll (/Users/pierregilles/code/gladys/server/lib/device/device.poll.js:21:5)
If I download the image, I realize its dimension is « 1333 × 2000 », whereas normally, the max image size is:
'-vf scale=640:-1', // resize the image with max width = 640
So this parameter no longer works when you add yours.
Regarding the « Delete » button, I added the resolution I had during my tests to reproduce it (on the PR)
pierre-gilles:
On the other hand, I have a small issue: since the image was rotated, the final image size is larger than the max image size we allow (100KB instead of max 75KB)
I have this error:
2023-07-03T10:53:51+0200 <warn> poll.js:14 (RtspCameraHandler.poll) Unable to poll camera
2023-07-03T10:53:51+0200 <debug> poll.js:15 (RtspCameraHandler.poll) BadParameters [Error]: Image is too big
at Camera.setImage (/Users/pierregilles/code/gladys/server/lib/device/camera/camera.setImage.js:18:11)
at RtspCameraHandler.poll (/Users/pierregilles/code/gladys/server/services/rtsp-camera/lib/poll.js:12:37)
at DeviceManager.poll (/Users/pierregilles/code/gladys/server/lib/device/device.poll.js:21:5)
If I download the image, I realize its dimensions are « 1333 × 2000 », whereas normally, the max image size is:
'-vf scale=640:-1', // resize the image with max width = 640
So this parameter doesn’t work anymore when you add yours.
Yes we can’t put multiple « -vf » in the same command, I just made the change on the PR
A little CSS bug, just the way I like them
1 Like
Thanks for the fixes @Lokkye , tested on my machine in real conditions, both with static images and live and it works perfectly
Same for the delete button!
I’ve merged into master, it will be included in the next Gladys release
1 Like