@revizly/sharp
Advanced tools
Comparing version 0.33.4-revizly5 to 0.33.4-revizly6
@@ -790,3 +790,3 @@ // Copyright 2013 Lovell Fuller and others. | ||
* | ||
* @param {Array<Array<number>>} inputMatrix - 3x3 Recombination matrix | ||
* @param {Array<Array<number>>} inputMatrix - 3x3 or 4x4 Recombination matrix | ||
* @returns {Sharp} | ||
@@ -796,15 +796,13 @@ * @throws {Error} Invalid parameters | ||
function recomb (inputMatrix) { | ||
if (!Array.isArray(inputMatrix) || inputMatrix.length !== 3 || | ||
inputMatrix[0].length !== 3 || | ||
inputMatrix[1].length !== 3 || | ||
inputMatrix[2].length !== 3 | ||
) { | ||
// must pass in a kernel | ||
throw new Error('Invalid recombination matrix'); | ||
if (!Array.isArray(inputMatrix)) { | ||
throw is.invalidParameterError('inputMatrix', 'array', inputMatrix); | ||
} | ||
this.options.recombMatrix = [ | ||
inputMatrix[0][0], inputMatrix[0][1], inputMatrix[0][2], | ||
inputMatrix[1][0], inputMatrix[1][1], inputMatrix[1][2], | ||
inputMatrix[2][0], inputMatrix[2][1], inputMatrix[2][2] | ||
].map(Number); | ||
if (inputMatrix.length !== 3 && inputMatrix.length !== 4) { | ||
throw is.invalidParameterError('inputMatrix', '3x3 or 4x4 array', inputMatrix.length); | ||
} | ||
const recombMatrix = inputMatrix.flat().map(Number); | ||
if (recombMatrix.length !== 9 && recombMatrix.length !== 16) { | ||
throw is.invalidParameterError('inputMatrix', 'cardinality of 9 or 16', recombMatrix.length); | ||
} | ||
this.options.recombMatrix = recombMatrix; | ||
return this; | ||
@@ -811,0 +809,0 @@ } |
{ | ||
"name": "@revizly/sharp", | ||
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images", | ||
"version": "0.33.4-revizly5", | ||
"version": "0.33.4-revizly6", | ||
"author": "Lovell Fuller <npm@lovell.info>", | ||
@@ -6,0 +6,0 @@ "homepage": "https://sharp.pixelplumbing.com", |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
498064
6976
2