Comparing version 1.0.5 to 1.0.6
@@ -74,2 +74,5 @@ "use strict"; | ||
this.height = this.readUInt32LE(); | ||
// negative value are possible here => implies bottom down | ||
this.height = | ||
this.height > 0x7fffffff ? this.height - 0x100000000 : this.height; | ||
this.planes = this.buffer.readUInt16LE(this.pos); | ||
@@ -76,0 +79,0 @@ this.pos += 2; |
@@ -5,6 +5,3 @@ /// <reference types="node" /> | ||
import { IDecoderOptions, IImage } from './types.js'; | ||
declare const _default: { | ||
decode: (bmpData: Buffer, options?: IDecoderOptions) => BmpDecoder; | ||
encode: (imgData: IImage) => BmpEncoder; | ||
}; | ||
export default _default; | ||
export declare function decode(bmpData: Buffer, options?: IDecoderOptions): BmpDecoder; | ||
export declare function encode(imgData: IImage): BmpEncoder; |
@@ -6,8 +6,13 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.encode = exports.decode = void 0; | ||
const decoder_js_1 = __importDefault(require("./decoder.js")); | ||
const encoder_js_1 = __importDefault(require("./encoder.js")); | ||
exports.default = { | ||
decode: (bmpData, options) => new decoder_js_1.default(bmpData, options), | ||
encode: (imgData) => new encoder_js_1.default(imgData), | ||
}; | ||
function decode(bmpData, options) { | ||
return new decoder_js_1.default(bmpData, options); | ||
} | ||
exports.decode = decode; | ||
function encode(imgData) { | ||
return new encoder_js_1.default(imgData); | ||
} | ||
exports.encode = encode; | ||
//# sourceMappingURL=index.js.map |
@@ -69,2 +69,5 @@ import HeaderTypes from './header-types.js'; | ||
this.height = this.readUInt32LE(); | ||
// negative value are possible here => implies bottom down | ||
this.height = | ||
this.height > 0x7fffffff ? this.height - 0x100000000 : this.height; | ||
this.planes = this.buffer.readUInt16LE(this.pos); | ||
@@ -71,0 +74,0 @@ this.pos += 2; |
@@ -5,6 +5,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
import { IDecoderOptions, IImage } from './types.js'; | ||
declare const _default: { | ||
decode: (bmpData: Buffer, options?: IDecoderOptions) => BmpDecoder; | ||
encode: (imgData: IImage) => BmpEncoder; | ||
}; | ||
export default _default; | ||
export declare function decode(bmpData: Buffer, options?: IDecoderOptions): BmpDecoder; | ||
export declare function encode(imgData: IImage): BmpEncoder; |
import BmpDecoder from './decoder.js'; | ||
import BmpEncoder from './encoder.js'; | ||
export default { | ||
decode: (bmpData, options) => new BmpDecoder(bmpData, options), | ||
encode: (imgData) => new BmpEncoder(imgData), | ||
}; | ||
export function decode(bmpData, options) { | ||
return new BmpDecoder(bmpData, options); | ||
} | ||
export function encode(imgData) { | ||
return new BmpEncoder(imgData); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "bmp-ts", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "A pure typescript BMP encoder and decoder", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
130249
1806
0