Skip to content
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

Provide a default implementation for ImageReader and ImageWriter #307

Closed
s1hofmann opened this issue Nov 3, 2021 · 0 comments · Fixed by #308
Closed

Provide a default implementation for ImageReader and ImageWriter #307

s1hofmann opened this issue Nov 3, 2021 · 0 comments · Fixed by #308
Labels
enhancement Enhancement to existing features
Milestone

Comments

@s1hofmann
Copy link
Member

Short overview
With image matching code moved out of the main package nut.js should ship a lightweight default of a ImageReader and ImageWriter implementation

Use case
Currently one would still have to pull in the platform/node version dependent @nut-tree/template-matcher package to store e.g. screenshots to disk.
Lightweight alternatives which can be shipped with the main package should solve this

@s1hofmann s1hofmann added the enhancement Enhancement to existing features label Nov 3, 2021
@s1hofmann s1hofmann added this to the v2.0.0 milestone Nov 3, 2021
s1hofmann added a commit that referenced this issue Nov 4, 2021
s1hofmann added a commit that referenced this issue Nov 4, 2021
s1hofmann added a commit that referenced this issue Nov 4, 2021
s1hofmann added a commit that referenced this issue Nov 4, 2021
s1hofmann added a commit that referenced this issue Nov 4, 2021
s1hofmann added a commit that referenced this issue Nov 5, 2021
* (#307) Add jimp dependencz

* (#307) Implement image reader

* (#307) Implement image writer

* (#307) Test data

* (#307) Register both providers

* (#307) Stick to BGR color format when loading images

* (#307) Expose imagereader and imagewriter through utility functions

* (#307) Updated tests to verify calls to Jimp

* (#307) Mock jimp in testcases using the pluginRegistry to avoid ReferenceErrors

* (#307) Mock jimp in e2e testcases to avoid ReferenceErrors
s1hofmann added a commit that referenced this issue Dec 17, 2021
* Bump tar from 4.4.13 to 4.4.15

Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v4.4.13...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump tar from 4.4.13 to 4.4.15 in /e2e/electron-test

Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v4.4.13...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump path-parse from 1.0.6 to 1.0.7

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* (#190) Rename private field native to nativeAdapter to stay consistent

* (#255) Only run sonar step if SONAR_TOKEN is set

* Added link to API docs to README.md

* (#260) Added missing lookup for 'delete' key

* (#262) Upgraded to Typescript 4.4.2 with minor adjustments

* (#265) Upgraded to SonarSource/sonarcloud-github-action v1.6

* Bump tar from 4.4.15 to 4.4.19 in /e2e/electron-test

Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v4.4.15...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Revert conditional execution of Sonar reports

* (#269) Export some internal objects

* (#271) Disable sonarcloud reporting to unstuck cross-platform checks

* (#271) Updated dependencies, fix conflicts

* (#271) Pin versions for clipboardy

* (#271) Move Jest timeout config out of test

* (#271) Debug failing AbortController test

* (#271) Revert node-abort-controller version bump due to inconsistencies. (Typescript complains on compile time, but after the change it fails on runtime)

* (#271) Fixed timeout configs in e2e tests

* Added demo video to README.md

* (#269) Changed export level and renamed classes to be less ambiguous

* (#278) Added grab and grabRegion methods to Screen

* (#278) Adjusted captureRegion and grabRegion parameters to accept Promises

* (#285) Added additional publish step for GitHub package registry

* (#258) Refined wording in snapshot release workflow

* Feature/292/provider registry (#293)

* (#292) Draft provider registry

* (#292) Register ImageWriter and ImageReader instances

* Feature/294/export provider interfaces (#295)

* (#294) Export interfaces for providers

* (#294) Align naming of interfaces

* (#296) Add missing export for ImageWriterParameters (#297)

* (#301) Exported FilType enum (#302)

* Feature/279/separate image matching (#298)

* (#279) Remove image matching provider code

* (#279) Remove image matching providers from registry

* (#279) Update vision adapter test

* (#279) Remove opencv4nodejs-prebuilt dependency

* (#279) Plugin e2e test

* (#279) Init plugin e2e test

* (#279) Align e2e package versions

* (#279) Fix resource path

* (#279) Add error info to output, formatting

* (#279) Run plugin test in Docker environment

* (#279) Export FileType enum

* (#279) Move screen e2e test to plugin e2e test subpackage since it requires the template-matcher package as well

* (#279) Move keyboard e2e test to plugin subpackage as well

* feat: adding the rest of the function keys (#305)

* (#130) Introduce EasingFunction interface (#304)

* (#130) Updated implementation

* (#130) Easing function refinement

* Feature/307/default imagereader imagewriter (#308)

* (#307) Add jimp dependencz

* (#307) Implement image reader

* (#307) Implement image writer

* (#307) Test data

* (#307) Register both providers

* (#307) Stick to BGR color format when loading images

* (#307) Expose imagereader and imagewriter through utility functions

* (#307) Updated tests to verify calls to Jimp

* (#307) Mock jimp in testcases using the pluginRegistry to avoid ReferenceErrors

* (#307) Mock jimp in e2e testcases to avoid ReferenceErrors

* Maintenance/310/remove adapters (#311)

* (#310) Delete both adapters

* (#310) Migrate window.function to not use adapters

* (#310) Migrated window.class to not use adapters

* (#310) Migrated screen.class to not use adapters

* (#310) Migrated movement.function to not use adapters

* (#310) Migrated mouse.class to not use adapters

* (#310) Remove leftover notions of adapters in test description

* (#310) Fixed expected format when saving a screenshot to disk

* (#310) Migrated keyboard.class to not use adapters

* (#310) Migrated clipboard.class to not use adapters

* (#310) Migrated assert.class test to not use adapters

* (#310) Migrated all exported instances to not use adapters

* (#310) Removed mention of adapter from test description

* Added sponsors listing to README.md

* (#306) Update supported cpus to include Apple Silicon (arm64)

* Add https://github.com/stoefln to sponsors listing

* Feature/204/screen find image needles (#319)

* (#204) Enabled passing of Image data to Screen#find

* (#204) Updated screen tests

* (#204) Removed plugin test from main repo

* (#204) Removed plugin test from Docker test runs

* (#204) Introduced additional id property to images

* (#204) Adjusted tests and image usage to new id property

* (#204) Added helper function to make loading image resources easier

* (#204) Adapted toShow matcher to new find parameters

* (#204) Re-use loadImageResource function

* Feature/320/find accept promise (#322)

* (#320) Make find, and the functions re-using it, accept Promise<Image>

* (#320) Update toShow matcher accordingly

* (#320) Update tests

* (#321) Added `findAll` to Screen (#323)

* Feature/259/get screen pixel color (#325)

* (#259) Introduced ImageProcessor interface

* (#259) imageToJimp converter function

* (#259) RGBA dataclass

* (#259) Implement ImageProcessor and register the new provider

* (#259) Re-use imageToJimp and clean up tests

* (#259) Fixed import for Image which was previously importing from dist

* Maintenance/310/remove adapters (#311)

* (#310) Delete both adapters

* (#310) Migrate window.function to not use adapters

* (#310) Migrated window.class to not use adapters

* (#310) Migrated screen.class to not use adapters

* (#310) Migrated movement.function to not use adapters

* (#310) Migrated mouse.class to not use adapters

* (#310) Remove leftover notions of adapters in test description

* (#310) Fixed expected format when saving a screenshot to disk

* (#310) Migrated keyboard.class to not use adapters

* (#310) Migrated clipboard.class to not use adapters

* (#310) Migrated assert.class test to not use adapters

* (#310) Migrated all exported instances to not use adapters

* (#310) Removed mention of adapter from test description

* Added sponsors listing to README.md

* (#306) Update supported cpus to include Apple Silicon (arm64)

* Add https://github.com/stoefln to sponsors listing

* Feature/204/screen find image needles (#319)

* (#204) Enabled passing of Image data to Screen#find

* (#204) Updated screen tests

* (#204) Removed plugin test from main repo

* (#204) Removed plugin test from Docker test runs

* (#204) Introduced additional id property to images

* (#204) Adjusted tests and image usage to new id property

* (#204) Added helper function to make loading image resources easier

* (#204) Adapted toShow matcher to new find parameters

* (#204) Re-use loadImageResource function

* Feature/320/find accept promise (#322)

* (#320) Make find, and the functions re-using it, accept Promise<Image>

* (#320) Update toShow matcher accordingly

* (#320) Update tests

* (#321) Added `findAll` to Screen (#323)

* (#259) Add `colorAt` to screen class

* (#324) Updated assert to handle valid find parameter types (#326)

* Feature/329/find image parameter type (#330)

* (#329) Make `Screen#find` only accept `Image` or `Promise<Image>` parameter type

* (#329) Update docstrings

* (#329) Adjusted tests

* (#329) Remove leftover string type checks

* (#327) Apply pixel density scaling when querying pixel color information (#332)

* (#312) Added new parameter `updateInterval` to `waitFor` to make the interval user configurable (#333)

* Feature/233/audio keys (#334)

* (#233) Extended key.enum with audio multimedia keys

* (#233) Extended Key mapping

* Feature/336/colormode conversion (#337)

* (#336) Introduced colormode enum

* (#336) Extended Image class with color mode conversion methods

* (#336) Set color mode on images when reading from disk

* (#336) Set colormode on images when grabbing screen content

* (#336) Limit switching of channels only to BGR images

* (#336) Export ColorMode enum

* (#336) Chasing down another async error in tests due to jimp

* Update README and docstrings

* Fix y offset for tests on macos-latest

* Maintenance/341/remove old code (#342)

* (#341) Remove Region#scaled

* (#341) Remove LocationParameters

* Maintenance/340/refine types (#343)

* (#340) Refactor the `data` property of `ImageWriterParameters` to `image`

* (#340) Refactor `Image#data` to a `Buffer` instead of `any`

* (#340) Fixed screen tests

* Re-enable sonar step (#344)

* Release/v2.0.0 rc1 (#345)

* Updated readme

* RC1

* Update @nut-tree/libnut to 2.1.3

* Center image in readme again

* Fixed typedoc config

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ahad <me@ahadcove.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant