@jimp/plugin-threshold
Advanced tools
Comparing version 0.16.3-canary.1125.1580.0 to 0.16.3
@@ -1,2 +0,2 @@ | ||
module.exports = api => { | ||
module.exports = (api) => { | ||
api.cache(true); | ||
@@ -7,17 +7,17 @@ | ||
[ | ||
'@babel/env', | ||
"@babel/env", | ||
{ | ||
useBuiltIns: 'usage' | ||
} | ||
] | ||
useBuiltIns: "usage", | ||
}, | ||
], | ||
], | ||
plugins: [ | ||
'@babel/proposal-class-properties', | ||
'@babel/syntax-object-rest-spread', | ||
process.env.BABEL_ENV !== 'module' && 'add-module-exports', | ||
"@babel/proposal-class-properties", | ||
"@babel/syntax-object-rest-spread", | ||
process.env.BABEL_ENV !== "module" && "add-module-exports", | ||
[ | ||
'transform-inline-environment-variables', | ||
{ include: ['BABEL_ENV', 'ENV'] } | ||
] | ||
"transform-inline-environment-variables", | ||
{ include: ["BABEL_ENV", "ENV"] }, | ||
], | ||
].filter(Boolean), | ||
@@ -27,14 +27,14 @@ | ||
test: { | ||
plugins: ['istanbul'] | ||
plugins: ["istanbul"], | ||
}, | ||
development: { | ||
plugins: [process.env.ENV !== 'browser' && 'source-map-support'].filter( | ||
plugins: [process.env.ENV !== "browser" && "source-map-support"].filter( | ||
Boolean | ||
) | ||
), | ||
}, | ||
module: { | ||
presets: [['@babel/env', { modules: false }]] | ||
} | ||
} | ||
presets: [["@babel/env", { modules: false }]], | ||
}, | ||
}, | ||
}; | ||
}; |
@@ -0,1 +1,13 @@ | ||
# v0.16.3 (Sat Feb 04 2023) | ||
#### ⚠️ Pushed to `master` | ||
- upgrade prettier ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### Authors: 1 | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
--- | ||
# v0.11.0 (Fri May 15 2020) | ||
@@ -27,3 +39,3 @@ | ||
#### 🐛 Bug Fix | ||
#### 🐛 Bug Fix | ||
@@ -36,2 +48,2 @@ - `@jimp/cli`, `@jimp/core`, `@jimp/custom`, `jimp`, `@jimp/plugin-blit`, `@jimp/plugin-blur`, `@jimp/plugin-circle`, `@jimp/plugin-color`, `@jimp/plugin-contain`, `@jimp/plugin-cover`, `@jimp/plugin-crop`, `@jimp/plugin-displace`, `@jimp/plugin-dither`, `@jimp/plugin-fisheye`, `@jimp/plugin-flip`, `@jimp/plugin-gaussian`, `@jimp/plugin-invert`, `@jimp/plugin-mask`, `@jimp/plugin-normalize`, `@jimp/plugin-print`, `@jimp/plugin-resize`, `@jimp/plugin-rotate`, `@jimp/plugin-scale`, `@jimp/plugin-shadow`, `@jimp/plugin-threshold`, `@jimp/plugins`, `@jimp/test-utils`, `@jimp/bmp`, `@jimp/gif`, `@jimp/jpeg`, `@jimp/png`, `@jimp/tiff`, `@jimp/types`, `@jimp/utils` | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn)) | ||
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn)) |
@@ -30,12 +30,12 @@ "use strict"; | ||
if (typeof max !== 'number') { | ||
return _utils.throwError.call(this, 'max must be a number', cb); | ||
if (typeof max !== "number") { | ||
return _utils.throwError.call(this, "max must be a number", cb); | ||
} | ||
if (typeof replace !== 'number') { | ||
return _utils.throwError.call(this, 'replace must be a number', cb); | ||
if (typeof replace !== "number") { | ||
return _utils.throwError.call(this, "replace must be a number", cb); | ||
} | ||
if (typeof autoGreyscale !== 'boolean') { | ||
return _utils.throwError.call(this, 'autoGreyscale must be a boolean', cb); | ||
if (typeof autoGreyscale !== "boolean") { | ||
return _utils.throwError.call(this, "autoGreyscale must be a boolean", cb); | ||
} | ||
@@ -42,0 +42,0 @@ |
@@ -1,11 +0,14 @@ | ||
import { ImageCallback } from '@jimp/core'; | ||
import { ImageCallback } from "@jimp/core"; | ||
interface Threshold { | ||
threshold(opts: { | ||
max: number, | ||
replace?: number, | ||
autoGreyscale?: boolean | ||
}, cb?: ImageCallback<this>): this; | ||
threshold( | ||
opts: { | ||
max: number; | ||
replace?: number; | ||
autoGreyscale?: boolean; | ||
}, | ||
cb?: ImageCallback<this> | ||
): this; | ||
} | ||
export default function(): Threshold; | ||
export default function (): Threshold; |
{ | ||
"name": "@jimp/plugin-threshold", | ||
"version": "0.16.3-canary.1125.1580.0", | ||
"version": "0.16.3", | ||
"description": "Lightens an image.", | ||
@@ -24,3 +24,3 @@ "main": "dist/index.js", | ||
"@babel/runtime": "^7.7.2", | ||
"@jimp/utils": "0.16.3-canary.1125.1580.0" | ||
"@jimp/utils": "^0.16.3" | ||
}, | ||
@@ -33,7 +33,7 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@jimp/custom": "0.16.3-canary.1125.1580.0", | ||
"@jimp/jpeg": "0.16.3-canary.1125.1580.0", | ||
"@jimp/plugin-color": "0.16.3-canary.1125.1580.0", | ||
"@jimp/plugin-resize": "0.16.3-canary.1125.1580.0", | ||
"@jimp/test-utils": "0.16.3-canary.1125.1580.0" | ||
"@jimp/custom": "^0.16.3", | ||
"@jimp/jpeg": "^0.16.3", | ||
"@jimp/plugin-color": "^0.16.3", | ||
"@jimp/plugin-resize": "^0.16.3", | ||
"@jimp/test-utils": "^0.16.3" | ||
}, | ||
@@ -43,3 +43,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "bfdb98aaf820272c06e332483b943d0ac58659db" | ||
"gitHead": "b9ac83d855d09deecde129a9c9b5b328ba7ea5b2" | ||
} |
@@ -19,6 +19,6 @@ <div align="center"> | ||
```js | ||
import jimp from 'jimp'; | ||
import jimp from "jimp"; | ||
async function main() { | ||
const image = await jimp.read('test/image.png'); | ||
const image = await jimp.read("test/image.png"); | ||
@@ -25,0 +25,0 @@ image.threshold({ max: 150 }); |
@@ -1,2 +0,2 @@ | ||
import { isNodePattern, throwError } from '@jimp/utils'; | ||
import { isNodePattern, throwError } from "@jimp/utils"; | ||
@@ -14,12 +14,12 @@ /** | ||
threshold({ max, replace = 255, autoGreyscale = true }, cb) { | ||
if (typeof max !== 'number') { | ||
return throwError.call(this, 'max must be a number', cb); | ||
if (typeof max !== "number") { | ||
return throwError.call(this, "max must be a number", cb); | ||
} | ||
if (typeof replace !== 'number') { | ||
return throwError.call(this, 'replace must be a number', cb); | ||
if (typeof replace !== "number") { | ||
return throwError.call(this, "replace must be a number", cb); | ||
} | ||
if (typeof autoGreyscale !== 'boolean') { | ||
return throwError.call(this, 'autoGreyscale must be a boolean', cb); | ||
if (typeof autoGreyscale !== "boolean") { | ||
return throwError.call(this, "autoGreyscale must be a boolean", cb); | ||
} | ||
@@ -48,3 +48,3 @@ | ||
return this; | ||
} | ||
}, | ||
}); |
@@ -1,8 +0,8 @@ | ||
import { Jimp, getTestDir } from '@jimp/test-utils'; | ||
import configure from '@jimp/custom'; | ||
import jpeg from '@jimp/jpeg'; | ||
import color from '@jimp/plugin-color'; | ||
import resize from '@jimp/plugin-resize'; | ||
import { Jimp, getTestDir } from "@jimp/test-utils"; | ||
import configure from "@jimp/custom"; | ||
import jpeg from "@jimp/jpeg"; | ||
import color from "@jimp/plugin-color"; | ||
import resize from "@jimp/plugin-resize"; | ||
import threshold from '../src'; | ||
import threshold from "../src"; | ||
@@ -14,11 +14,11 @@ const jimp = configure( | ||
describe('Threshold', function() { | ||
describe("Threshold", function () { | ||
this.timeout(15000); | ||
it('defines default threshold for lighter backgrounds', async () => { | ||
it("defines default threshold for lighter backgrounds", async () => { | ||
const expectedImage = await jimp.read( | ||
getTestDir(__dirname) + '/images/hands_mx200_rp255.jpg' | ||
getTestDir(__dirname) + "/images/hands_mx200_rp255.jpg" | ||
); | ||
const testImage = await jimp.read( | ||
getTestDir(__dirname) + '/images/hands.jpg' | ||
getTestDir(__dirname) + "/images/hands.jpg" | ||
); | ||
@@ -25,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
667541
12
164
+ Added@jimp/utils@0.16.13(transitive)
- Removed@jimp/utils@0.16.3-canary.1125.1580.0(transitive)
Updated@jimp/utils@^0.16.3