adrianrdzv
(Adrian Rodriguez)
January 13, 2024, 12:04am
1
I’m trying to resize AND crop a camera snapshot to send it as notification image to my android device. I’m trying to get a 2:1 image: from an original 1280 × 960, a resized to 1024 × 768, and then cropped to 1024 x 512
However, this is not working:
camera:
- platform: proxy
entity_id: camera.timbre_sub
name: timbre_sub_resized
max_image_width: 1024
image_quality: 60
- platform: proxy
entity_id: camera.timbre_sub_resized
mode: crop
name: timbre_sub_cropped
image_top: 256
max_image_height: 512
The image I get in timbre_sub_cropped is basically the resized one: 1024 × 768, the second proxy camera is not doing the crop. Anyone has ideas on why?
adrianrdzv
(Adrian Rodriguez)
January 13, 2024, 2:04am
2
For anyone also struggling with this, after more investigation, seems that the reverse order works: first do the crop then the resize:
camera:
- platform: proxy
entity_id: camera.timbre_sub
name: timbre_sub_cropped
mode: crop
image_top: 320
max_image_height: 1440
image_quality: 60
- platform: proxy
entity_id: camera. timbre_sub_cropped
name: timbre_sub_resized
max_image_width: 1024
Even more interesting, if I change the image_quality
parameter to the resizing action again it doesn’t work:
camera:
- platform: proxy
entity_id: camera.timbre_sub
name: timbre_sub_cropped
mode: crop
image_top: 320
max_image_height: 1440
- platform: proxy
entity_id: camera. timbre_sub_cropped
name: timbre_sub_resized
max_image_width: 1024
image_quality: 60
Hope it helps anyone else.
direx1
(Direx1)
May 22, 2024, 10:49pm
4
Does the proxy produce a new entity Id or just change the existing one? Ideally I’d like to use both images.