hass-agent / HASS.Agent

Unofficial development project for the HASS.Agent platform.
https://hass-agent.io
MIT License
210 stars 7 forks source link

Bug: Screenshot Sensor incorrect handling of 21:9 Ratio #81

Open ElDingo424 opened 2 months ago

ElDingo424 commented 2 months ago

Describe the bug Screenshot sensor does not properly capture 21:9 Aspect Ratio, clips off right side.

To Reproduce -21:9 aspect ratio -Observe screenshot received in dashboard

Expected behavior Full screen should be captured and displayed.

Screenshots image Image from screenshot sensor - 2 application windows set to half screen for reference.

image Expected image.

Misc info:

Additional context Currently screen is at 125% scaling, changing to 100% scaling has no observable affect. Resolution is 3440x1440

amadeo-alex commented 2 months ago

Now if I only had a ultra wide monitor :D I'll take a look if I can find a "dry" solution to this and then supply you with a custom build that can be tested - if you'd be up to it of course.

amadeo-alex commented 2 months ago

Hmm, looks like there is more depth to it, even setting one of my screens to 150% scaling causes the image to have more or less only the top left quarter.

ElDingo424 commented 2 months ago

I would be willing to test whatever you like, just let me know. (and have some grace as I'm somewhat new to all this)

amadeo-alex commented 2 months ago

Here you go: https://github.com/amadeo-alex/HASS.Agent/releases/tag/2.1.0-beta2-screenshot-scaling (note that it's from my repository where dev work happens)

This is also mentioned under the link but the fix attempt was done based on 2.1.0-beta2 branch so it also includes other changes.

And one more thing: please create backup of your config before installing the test version :D

ElDingo424 commented 2 months ago

It looks like the screen does capture properly in this new version.

image Is there any other details you need?

amadeo-alex commented 2 months ago

If it is working as expected then excellent :) I'll clean up the code and make it part of the official 2.0.1-beta2 release.