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

Bugfix/nt 72/drop alpha channel #572

Merged
merged 5 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/snapshot_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,3 @@ jobs:
run: pnpm run publish:next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v3
with:
registry-url: "https://npm.pkg.github.com"
- name: Publish snapshot release to GPR
run: npm run publish:next
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 0 additions & 7 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,3 @@ jobs:
run: pnpm run publish:release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v3
with:
registry-url: "https://npm.pkg.github.com"
- name: Publish tagged release to GPR
run: pnpm run publish:release
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion core/nut.js/lib/provider/io/jimp-image-reader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class implements ImageReader {
jimpImage.bitmap.width,
jimpImage.bitmap.height,
jimpImage.bitmap.data,
jimpImage.hasAlpha() ? 4 : 3,
4,
parameters,
jimpImage.bitmap.data.length /
(jimpImage.bitmap.width * jimpImage.bitmap.height),
Expand Down
5 changes: 3 additions & 2 deletions core/shared/lib/objects/rgba.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ export class RGBA {
public readonly G: number,
public readonly B: number,
public readonly A: number
) {}
) {
}

public toString(): string {
return `rgb(${this.R},${this.G},${this.B})`;
return `rgba(${this.R},${this.G},${this.B},${this.A})`;
}

public toHex(): string {
Expand Down
4 changes: 2 additions & 2 deletions providers/libnut/lib/libnut-screen.class.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("libnut screen action", () => {
colorAt: jest.fn(),
height: screenShotSize.height,
image: Buffer.from(
new Array(screenShotSize.width * screenShotSize.height * 4 + 10).fill(
new Array(screenShotSize.width * screenShotSize.height * 4).fill(
0
)
),
Expand Down Expand Up @@ -72,7 +72,7 @@ describe("libnut screen action", () => {
colorAt: jest.fn(),
height: screenShotSize.height,
image: Buffer.from(
new Array(screenShotSize.width * screenShotSize.height * 4 + 10).fill(
new Array(screenShotSize.width * screenShotSize.height * 4).fill(
0
)
),
Expand Down
4 changes: 2 additions & 2 deletions providers/libnut/lib/libnut-screen.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class ScreenAction implements ScreenProviderInterface {
new Image(
screenShot.width,
screenShot.height,
screenShot.image.slice(0, screenShot.width * screenShot.height * 4),
screenShot.image,
4,
"grabScreenResult",
screenShot.bitsPerPixel,
Expand Down Expand Up @@ -62,7 +62,7 @@ export default class ScreenAction implements ScreenProviderInterface {
new Image(
screenShot.width,
screenShot.height,
screenShot.image.slice(0, screenShot.width * screenShot.height * 4),
screenShot.image,
4,
"grabScreenRegionResult",
screenShot.bitsPerPixel,
Expand Down
Loading