@jimp/js-bmp
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,4 +9,7 @@ import * as BMP from "bmp-ts"; | ||
export type EncodeOptions = Pretty<Partial<Pick<BMP.BmpImage, "palette" | "colors" | "importantColors" | "hr" | "vr" | "reserved1" | "reserved2">>>; | ||
export interface DecodeBmpOptions { | ||
toRGBA?: boolean; | ||
} | ||
declare function encode(image: Bitmap, options?: EncodeOptions): Buffer; | ||
declare function decode(data: Buffer): Bitmap; | ||
declare function decode(data: Buffer, options?: DecodeBmpOptions): Bitmap; | ||
export declare function msBmp(): { | ||
@@ -13,0 +16,0 @@ mime: "image/x-ms-bmp"; |
@@ -46,4 +46,4 @@ "use strict"; | ||
} | ||
function decode(data) { | ||
const result = BMP.decode(data); | ||
function decode(data, options) { | ||
const result = BMP.decode(data, options); | ||
(0, utils_1.scan)({ bitmap: result }, 0, 0, result.width, result.height, function (_, __, index) { | ||
@@ -50,0 +50,0 @@ // const alpha = result.data[index + 0]!; |
@@ -9,4 +9,7 @@ import * as BMP from "bmp-ts"; | ||
export type EncodeOptions = Pretty<Partial<Pick<BMP.BmpImage, "palette" | "colors" | "importantColors" | "hr" | "vr" | "reserved1" | "reserved2">>>; | ||
export interface DecodeBmpOptions { | ||
toRGBA?: boolean; | ||
} | ||
declare function encode(image: Bitmap, options?: EncodeOptions): Buffer; | ||
declare function decode(data: Buffer): Bitmap; | ||
declare function decode(data: Buffer, options?: DecodeBmpOptions): Bitmap; | ||
export declare function msBmp(): { | ||
@@ -13,0 +16,0 @@ mime: "image/x-ms-bmp"; |
@@ -17,4 +17,4 @@ import * as BMP from "bmp-ts"; | ||
} | ||
function decode(data) { | ||
const result = BMP.decode(data); | ||
function decode(data, options) { | ||
const result = BMP.decode(data, options); | ||
scan({ bitmap: result }, 0, 0, result.width, result.height, function (_, __, index) { | ||
@@ -21,0 +21,0 @@ // const alpha = result.data[index + 0]!; |
{ | ||
"name": "@jimp/js-bmp", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"repository": "jimp-dev/jimp", | ||
@@ -19,7 +19,7 @@ "engines": { | ||
"devDependencies": { | ||
"@jimp/config-eslint": "1.4.0", | ||
"@jimp/config-typescript": "1.4.0", | ||
"@jimp/config-vitest": "1.4.0", | ||
"@jimp/js-png": "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/js-png": "1.5.0", | ||
"@jimp/test-utils": "1.5.0", | ||
"@types/node": "^18.19.48", | ||
@@ -59,5 +59,5 @@ "@vitest/browser": "^2.0.5", | ||
"dependencies": { | ||
"@jimp/core": "1.4.0", | ||
"@jimp/types": "1.4.0", | ||
"@jimp/utils": "1.4.0", | ||
"@jimp/core": "1.5.0", | ||
"@jimp/types": "1.5.0", | ||
"@jimp/utils": "1.5.0", | ||
"bmp-ts": "^1.0.9" | ||
@@ -70,3 +70,3 @@ }, | ||
"module": "./dist/esm/index.js", | ||
"gitHead": "c1b91e9007f17d0702894bd9bfab8215cff764f9" | ||
"gitHead": "9b8d6106ef2498113ebcdddf8e6a4fae0b3cadff" | ||
} |
@@ -33,2 +33,6 @@ import * as BMP from "bmp-ts"; | ||
export interface DecodeBmpOptions { | ||
toRGBA?: boolean; | ||
} | ||
function encode(image: Bitmap, options: EncodeOptions = {}) { | ||
@@ -51,3 +55,3 @@ scan( | ||
image.data[index + 3] = red; | ||
}, | ||
} | ||
); | ||
@@ -58,4 +62,4 @@ | ||
function decode(data: Buffer) { | ||
const result = BMP.decode(data); | ||
function decode(data: Buffer, options?: DecodeBmpOptions) { | ||
const result = BMP.decode(data, options); | ||
@@ -78,3 +82,3 @@ scan( | ||
result.data[index + 3] = 0xff; | ||
}, | ||
} | ||
); | ||
@@ -81,0 +85,0 @@ |
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
336457
337
+ 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
Updated@jimp/utils@1.5.0