-
-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix blur on transparent images (#1315)
* Fix blur with transparent pixels (cherry picked from commit 3cd49fd) * make it a node test cause of snapshot
- Loading branch information
1 parent
0afb0a1
commit a033a52
Showing
8 changed files
with
59 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,23 @@ | |
"scripts": { | ||
"lint": "eslint .", | ||
"test": "vitest", | ||
"test:browser": "vitest --config vitest.config.browser.mjs", | ||
"build": "tshy", | ||
"dev": "tshy --watch", | ||
"clean": "rm -rf node_modules .tshy .tshy-build dist .turbo" | ||
}, | ||
"author": "Andrew Lisowski <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@jimp/types": "workspace:*" | ||
"@jimp/core": "workspace:*", | ||
"@jimp/utils": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@jimp/config-eslint": "workspace:*", | ||
"@jimp/config-typescript": "workspace:*", | ||
"@jimp/config-vitest": "workspace:*", | ||
"@jimp/js-png": "workspace:*", | ||
"@jimp/test-utils": "workspace:*", | ||
"@jimp/types": "workspace:*", | ||
"@vitest/browser": "^1.4.0", | ||
"eslint": "^8.57.0", | ||
"tshy": "^3.0.2", | ||
|
Binary file added
BIN
+218 KB
...index-node-test-ts-src-index-node-test-ts-has-alpha-image-with-alpha-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { describe, expect, test } from "vitest"; | ||
import { createJimp } from "@jimp/core"; | ||
import { getTestImagePath } from "@jimp/test-utils"; | ||
import "@jimp/test-utils/image-snapshot"; | ||
import png from "@jimp/js-png"; | ||
|
||
import * as blur from "./index.js"; | ||
|
||
const Jimp = createJimp({ formats: [png], plugins: [blur.methods] }); | ||
|
||
describe("hasAlpha", () => { | ||
test("image with alpha", async () => { | ||
const image = await Jimp.read(getTestImagePath("dice.png")); | ||
const output = await image.blur(16).getBuffer("image/png"); | ||
expect(output).toMatchImageSnapshot(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.