@napi-rs/image 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +13 -3
  2. package/index.js +2 -1
  3. package/package.json +15 -15
package/index.d.ts CHANGED
@@ -102,6 +102,18 @@ export interface PngEncodeOptions {
102
102
  /** Default is `FilterType::NoFilter` */
103
103
  filterType?: FilterType
104
104
  }
105
+ export const enum PngRowFilter {
106
+ None = 0,
107
+ Sub = 1,
108
+ Up = 2,
109
+ Average = 3,
110
+ Paeth = 4,
111
+ MinSum = 5,
112
+ Entropy = 6,
113
+ Bigrams = 7,
114
+ BigEnt = 8,
115
+ Brute = 9
116
+ }
105
117
  export interface PNGLosslessOptions {
106
118
  /**
107
119
  * Attempt to fix errors when decoding the input file rather than returning an Err.
@@ -114,7 +126,7 @@ export interface PNGLosslessOptions {
114
126
  */
115
127
  force?: boolean
116
128
  /** Which filters to try on the file (0-5) */
117
- filter?: Array<number>
129
+ filter?: Array<PngRowFilter>
118
130
  /**
119
131
  * Whether to attempt bit depth reduction
120
132
  * Default: `true`
@@ -143,8 +155,6 @@ export interface PNGLosslessOptions {
143
155
  idatRecoding?: boolean
144
156
  /** Whether to remove ***All non-critical headers*** on PNG */
145
157
  strip?: boolean
146
- /** Whether to use heuristics to pick the best filter and compression */
147
- useHeuristics?: boolean
148
158
  }
149
159
  export function losslessCompressPngSync(input: Buffer, options?: PNGLosslessOptions | undefined | null): Buffer
150
160
  export function losslessCompressPng(input: Buffer, options?: PNGLosslessOptions | undefined | null, signal?: AbortSignal | undefined | null): Promise<Buffer>
package/index.js CHANGED
@@ -246,13 +246,14 @@ if (!nativeBinding) {
246
246
  throw new Error(`Failed to load native binding`)
247
247
  }
248
248
 
249
- const { ChromaSubsampling, compressJpegSync, compressJpeg, CompressionType, FilterType, losslessCompressPngSync, losslessCompressPng, pngQuantizeSync, pngQuantize, Orientation, ResizeFilterType, JsColorType, Transformer } = nativeBinding
249
+ const { ChromaSubsampling, compressJpegSync, compressJpeg, CompressionType, FilterType, PngRowFilter, losslessCompressPngSync, losslessCompressPng, pngQuantizeSync, pngQuantize, Orientation, ResizeFilterType, JsColorType, Transformer } = nativeBinding
250
250
 
251
251
  module.exports.ChromaSubsampling = ChromaSubsampling
252
252
  module.exports.compressJpegSync = compressJpegSync
253
253
  module.exports.compressJpeg = compressJpeg
254
254
  module.exports.CompressionType = CompressionType
255
255
  module.exports.FilterType = FilterType
256
+ module.exports.PngRowFilter = PngRowFilter
256
257
  module.exports.losslessCompressPngSync = losslessCompressPngSync
257
258
  module.exports.losslessCompressPng = losslessCompressPng
258
259
  module.exports.pngQuantizeSync = pngQuantizeSync
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/image",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "description": "Image processing library",
@@ -61,21 +61,21 @@
61
61
  },
62
62
  "repository": "git@github.com:Brooooooklyn/Image.git",
63
63
  "devDependencies": {
64
- "@napi-rs/cli": "^2.13.2"
64
+ "@napi-rs/cli": "^2.14.1"
65
65
  },
66
- "gitHead": "f04033cfe1195d94882bf108cdf638b9a8c023cf",
66
+ "gitHead": "fdd80a15bf0f215383c622a4361a3b74dd22bddd",
67
67
  "optionalDependencies": {
68
- "@napi-rs/image-win32-x64-msvc": "1.4.2",
69
- "@napi-rs/image-darwin-x64": "1.4.2",
70
- "@napi-rs/image-linux-x64-gnu": "1.4.2",
71
- "@napi-rs/image-darwin-arm64": "1.4.2",
72
- "@napi-rs/image-android-arm64": "1.4.2",
73
- "@napi-rs/image-linux-arm64-gnu": "1.4.2",
74
- "@napi-rs/image-linux-arm64-musl": "1.4.2",
75
- "@napi-rs/image-linux-arm-gnueabihf": "1.4.2",
76
- "@napi-rs/image-linux-x64-musl": "1.4.2",
77
- "@napi-rs/image-freebsd-x64": "1.4.2",
78
- "@napi-rs/image-win32-ia32-msvc": "1.4.2",
79
- "@napi-rs/image-android-arm-eabi": "1.4.2"
68
+ "@napi-rs/image-win32-x64-msvc": "1.4.4",
69
+ "@napi-rs/image-darwin-x64": "1.4.4",
70
+ "@napi-rs/image-linux-x64-gnu": "1.4.4",
71
+ "@napi-rs/image-darwin-arm64": "1.4.4",
72
+ "@napi-rs/image-android-arm64": "1.4.4",
73
+ "@napi-rs/image-linux-arm64-gnu": "1.4.4",
74
+ "@napi-rs/image-linux-arm64-musl": "1.4.4",
75
+ "@napi-rs/image-linux-arm-gnueabihf": "1.4.4",
76
+ "@napi-rs/image-linux-x64-musl": "1.4.4",
77
+ "@napi-rs/image-freebsd-x64": "1.4.4",
78
+ "@napi-rs/image-win32-ia32-msvc": "1.4.4",
79
+ "@napi-rs/image-android-arm-eabi": "1.4.4"
80
80
  }
81
81
  }