-
Notifications
You must be signed in to change notification settings - Fork 278
fix: get screen density of android devices #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
thanks. we are gonna check this soon |
|
@hiking93 This looks neat and is a very good patch. Only change I'll ask is that instead of throwing an exception (which is very unlikely to happen in our scenario, the device is working properly), let's assume the dpi is 160 so there's no scaling. It'll make the code simpler and remove an exception that needs to be tested. What do you think, should we make this change? |
|
@hiking93 I just realized something. my emulated device has value of 560, which means 560/160=3.5 I just need to test this thoroughly to make sure taps on screenshot coordinates dont get broken (they're not stable regardless because of the way LLMs work). Need to make sure imagemagick supports scaling down by 3.5 factor. |
Sure, I've updated the implementation: 8e4267c |
I tried a Pixel 9 Pro Fold emulator:
|
To my knowledge, |
Image compression is using
screenSize.scaleas the resize factor:mobile-mcp/src/server.ts
Line 439 in 4c026a6
But
scaleis currently hard-coded to1for Android, so while the file size is reduced, the resolution of the image won't be scaled, causing #140.