@jimp/js-png
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -0,1 +1,23 @@ | ||
# v1.5.0 (Sat Sep 07 2024) | ||
### Release Notes | ||
#### Add support for image decoder options ([#1336](https://github.com/jimp-dev/jimp/pull/1336)) | ||
Can now have options for the underlying image codecs | ||
![CleanShot 2024-09-07 at 15 26 41](https://github.com/user-attachments/assets/26fa1a48-f463-455c-89f9-9c99f9fcb3d1) | ||
--- | ||
#### 🚀 Enhancement | ||
- Add support for image decoder options [#1336](https://github.com/jimp-dev/jimp/pull/1336) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### Authors: 1 | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
--- | ||
# v1.1.3 (Mon Sep 02 2024) | ||
@@ -2,0 +24,0 @@ |
@@ -9,2 +9,6 @@ import { PNGOptions as PNGJSOptions } from "pngjs"; | ||
}; | ||
export interface DecodePngOptions { | ||
checkCRC?: boolean | undefined; | ||
skipRescale?: boolean | undefined; | ||
} | ||
export * from "./constants.js"; | ||
@@ -15,3 +19,3 @@ export default function png(): { | ||
encode: (bitmap: import("@jimp/types").Bitmap, { deflateLevel, deflateStrategy, filterType, colorType, inputHasAlpha, ...options }?: PNGOptions) => Buffer; | ||
decode: (data: Buffer) => { | ||
decode: (data: Buffer, options?: DecodePngOptions) => { | ||
data: Buffer; | ||
@@ -18,0 +22,0 @@ width: number; |
@@ -44,4 +44,4 @@ "use strict"; | ||
}, | ||
decode: (data) => { | ||
const result = pngjs_1.PNG.sync.read(data); | ||
decode: (data, options) => { | ||
const result = pngjs_1.PNG.sync.read(data, options); | ||
return { | ||
@@ -48,0 +48,0 @@ data: result.data, |
@@ -9,2 +9,6 @@ import { PNGOptions as PNGJSOptions } from "pngjs"; | ||
}; | ||
export interface DecodePngOptions { | ||
checkCRC?: boolean | undefined; | ||
skipRescale?: boolean | undefined; | ||
} | ||
export * from "./constants.js"; | ||
@@ -15,3 +19,3 @@ export default function png(): { | ||
encode: (bitmap: import("@jimp/types").Bitmap, { deflateLevel, deflateStrategy, filterType, colorType, inputHasAlpha, ...options }?: PNGOptions) => Buffer; | ||
decode: (data: Buffer) => { | ||
decode: (data: Buffer, options?: DecodePngOptions) => { | ||
data: Buffer; | ||
@@ -18,0 +22,0 @@ width: number; |
@@ -27,4 +27,4 @@ import { PNG } from "pngjs"; | ||
}, | ||
decode: (data) => { | ||
const result = PNG.sync.read(data); | ||
decode: (data, options) => { | ||
const result = PNG.sync.read(data, options); | ||
return { | ||
@@ -31,0 +31,0 @@ data: result.data, |
{ | ||
"name": "@jimp/js-png", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"repository": "jimp-dev/jimp", | ||
@@ -19,11 +19,11 @@ "engines": { | ||
"dependencies": { | ||
"@jimp/core": "1.4.0", | ||
"@jimp/types": "1.4.0", | ||
"@jimp/core": "1.5.0", | ||
"@jimp/types": "1.5.0", | ||
"pngjs": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@jimp/config-eslint": "1.4.0", | ||
"@jimp/config-typescript": "1.4.0", | ||
"@jimp/config-vitest": "1.4.0", | ||
"@jimp/test-utils": "1.4.0", | ||
"@jimp/config-eslint": "1.5.0", | ||
"@jimp/config-typescript": "1.5.0", | ||
"@jimp/config-vitest": "1.5.0", | ||
"@jimp/test-utils": "1.5.0", | ||
"@types/pngjs": "^6.0.5", | ||
@@ -67,3 +67,3 @@ "@vitest/browser": "^2.0.5", | ||
"module": "./dist/esm/index.js", | ||
"gitHead": "c1b91e9007f17d0702894bd9bfab8215cff764f9" | ||
"gitHead": "9b8d6106ef2498113ebcdddf8e6a4fae0b3cadff" | ||
} |
@@ -15,2 +15,7 @@ import { PNG, PNGOptions as PNGJSOptions } from "pngjs"; | ||
export interface DecodePngOptions { | ||
checkCRC?: boolean | undefined; | ||
skipRescale?: boolean | undefined; | ||
} | ||
export * from "./constants.js"; | ||
@@ -31,3 +36,3 @@ | ||
...options | ||
}: PNGOptions = {}, | ||
}: PNGOptions = {} | ||
) => { | ||
@@ -55,4 +60,4 @@ const png = new PNG({ | ||
}, | ||
decode: (data) => { | ||
const result = PNG.sync.read(data); | ||
decode: (data, options?: DecodePngOptions) => { | ||
const result = PNG.sync.read(data, options); | ||
@@ -59,0 +64,0 @@ return { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
32346
444
+ Added@jimp/core@1.5.0(transitive)
+ Added@jimp/file-ops@1.5.0(transitive)
+ Added@jimp/types@1.5.0(transitive)
+ Added@jimp/utils@1.5.0(transitive)
- Removed@jimp/core@1.4.0(transitive)
- Removed@jimp/file-ops@1.4.0(transitive)
- Removed@jimp/types@1.4.0(transitive)
- Removed@jimp/utils@1.4.0(transitive)
Updated@jimp/core@1.5.0
Updated@jimp/types@1.5.0