decode-ico
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -0,1 +1,3 @@ | ||
import ImageData = require('@canvas/image-data') | ||
declare interface Hotspot { | ||
@@ -6,13 +8,19 @@ x: number | ||
declare interface ImageData { | ||
declare interface BmpData extends ImageData { | ||
bpp: number | ||
hotspot: Hotspot | null | ||
type: 'bmp' | ||
} | ||
declare interface PngData { | ||
bpp: number | ||
data: Uint8Array | ||
height: number | ||
hotspot: Hotspot | null | ||
type: 'bmp' | 'png' | ||
type: 'png' | ||
width: number | ||
} | ||
declare function decodeIco (source: ArrayBuffer | Uint8Array): ImageData[] | ||
declare function decodeIco (source: ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray): (BmpData | PngData)[] | ||
export = decodeIco |
11
index.js
const toDataView = require('to-data-view') | ||
const decodeBmp = require('decode-bmp') | ||
const ImageData = require('@canvas/image-data') | ||
@@ -76,12 +77,6 @@ function isPng (view, offset) { | ||
const bmp = decodeBmp(data, { width, height, icon: true }) | ||
const info = { bpp: bmp.colorDepth, hotspot, type: 'bmp' } | ||
return { | ||
bpp: bmp.colorDepth, | ||
data: bmp.data, | ||
height: bmp.height, | ||
hotspot, | ||
type: 'bmp', | ||
width: bmp.width | ||
} | ||
return Object.assign(new ImageData(bmp.data, bmp.width, bmp.height), info) | ||
}) | ||
} |
{ | ||
"name": "decode-ico", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -14,14 +14,15 @@ "repository": "LinusU/decode-ico", | ||
"dependencies": { | ||
"decode-bmp": "^0.1.0", | ||
"to-data-view": "^1.0.0" | ||
"@canvas/image-data": "^1.0.0", | ||
"decode-bmp": "^0.2.0", | ||
"to-data-view": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"globby": "^8.0.1", | ||
"lodepng": "^1.1.0", | ||
"mocha": "^5.2.0", | ||
"standard": "^11.0.1" | ||
"globby": "^10.0.1", | ||
"lodepng": "^2.0.0", | ||
"mocha": "^6.2.2", | ||
"standard": "^14.3.1" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8.6" | ||
} | ||
} |
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
4981
83
3
+ Added@canvas/image-data@^1.0.0
+ Added@canvas/image-data@1.0.0(transitive)
+ Addeddecode-bmp@0.2.1(transitive)
- Removeddecode-bmp@0.1.0(transitive)
Updateddecode-bmp@^0.2.0
Updatedto-data-view@^1.1.0