@eris/image
Advanced tools
Comparing version
@@ -5,2 +5,3 @@ "use strict"; | ||
function opacity(background, foreground, opacity) { | ||
const isUint8 = background.data instanceof Uint8Array || background.data instanceof Uint8ClampedArray; | ||
if (background.colorspace !== foreground.colorspace) | ||
@@ -10,3 +11,3 @@ throw new Error('Colorspaces must match'); | ||
throw new Error('Sizes must match'); | ||
if (!(background.data instanceof Uint8Array)) | ||
if (!isUint8) | ||
throw new Error('Must be Uint8Array'); | ||
@@ -13,0 +14,0 @@ const alphaForeground = opacity; |
@@ -8,5 +8,7 @@ import {IAnnotatedImageData, ImageData} from '../image-data' | ||
): IAnnotatedImageData { | ||
const isUint8 = | ||
background.data instanceof Uint8Array || background.data instanceof Uint8ClampedArray | ||
if (background.colorspace !== foreground.colorspace) throw new Error('Colorspaces must match') | ||
if (background.data.length !== foreground.data.length) throw new Error('Sizes must match') | ||
if (!(background.data instanceof Uint8Array)) throw new Error('Must be Uint8Array') | ||
if (!isUint8) throw new Error('Must be Uint8Array') | ||
@@ -13,0 +15,0 @@ const alphaForeground = opacity |
{ | ||
"name": "@eris/image", | ||
"version": "0.1.1-alpha.6", | ||
"version": "0.1.1-alpha.7", | ||
"description": "Collection of image manipulation libraries for node and the browser.", | ||
@@ -38,3 +38,3 @@ "main": "./dist/node-index.js", | ||
"dependencies": { | ||
"@eris/exif": "0.1.1-alpha.6", | ||
"@eris/exif": "0.1.1-alpha.7", | ||
"buffer": "^5.2.0", | ||
@@ -71,3 +71,3 @@ "file-type": "^7.0.1", | ||
}, | ||
"gitHead": "3083b1547f4ef718915a7d143e4cea0bc340d84c" | ||
"gitHead": "30d0b6dbd9e655e2ea2a986862eeb93b59c8e0e1" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1573412
0.04%13316
0.03%+ Added
- Removed
Updated