-
-
Notifications
You must be signed in to change notification settings - Fork 161
Description
Version
next
Short overview
Screenshots based on Regions on macOS are do not reflect screen content.
Issue occurs on
- Virtual machine
- Docker container
- Dev/Host system
Detailed error description
I'm using the following workaround from #154 to create a screenshot of a region
const regionCapture = async (
selectedRegion: NutRegion,
outputFilename: string
) => {
const regionImage = await (<any>screen).vision.grabScreenRegion(
selectedRegion
);
await (<any>screen).vision.saveImage(regionImage, outputFilename);
};
Based on the provided region, I receive various errors or incorrect images.
I'm working on a 1920x1080 build agent and configured it as described here.
with new NutRegion(0, 100, 650, 200)
I get:
with new NutRegion(0, 50, 325, 100)
I get:
Just thought a reduction of the resolution could help.
with new NutRegion(0, 0, 1900, 1000)
I get:
[Wed Dec 09 2020 13:04:35 GMT+0000 (Coordinated Universal Time)] ERROR: Error in testcase getTextFromRegion: Error: Given width exceeds display dimensions
Error: Error: Given width exceeds display dimensions
at Object.module.exports.screen.capture (/Users/runner/work/sakuli-ocr/sakuli-ocr/packages/sakuli-ocr/node_modules/@nut-tree/libnut-darwin/index.js:32:16)
at /Users/runner/work/sakuli-ocr/sakuli-ocr/packages/sakuli-ocr/node_modules/@nut-tree/nut-js/dist/lib/provider/native/libnut-screen-action.class.js:30:46
at new Promise (<anonymous>)
at ScreenAction.grabScreenRegion (/Users/runner/work/sakuli-ocr/sakuli-ocr/packages/sakuli-ocr/node_modules/@nut-tree/nut-js/dist/lib/provider/native/libnut-screen-action.class.js:29:16)
at VisionAdapter.grabScreenRegion (/Users/runner/work/sakuli-ocr/sakuli-ocr/packages/sakuli-ocr/node_modules/@nut-tree/nut-js/dist/lib/adapter/vision.adapter.class.js:43:28)
Whole screen
Funny enough, when I take a screenshot with grabScreen
, it looks as expected.
Steps to reproduce error
As this happens on a build agent and because I've no mac myself, I cannot provide any information, unfortunately.