Open houd1ni opened 1 year ago
@mikolalysenko any chance fixing the security issue ? Is this project still maintained ?
@SVillette hi! I'm about to fix it in a special fork as told in that attached issue. Thanks for reminding. Will post it here with mention.
Any update? 👀
Any update? 👀
Almost got back here. 🐌
For anyone blocked on this issue — I'm maintaining a near-equivalent library, ndarray-pixels
, based on get-pixels
and save-pixels
. Some differences to note:
ndarray-pixels
uses Canvas2D and imports no dependencies. Browserify is no longer required.ndarray-pixels
now uses sharp. Sharp includes support for considerably more image formats.getPixels
returns a Promise<ndarray<Uint8Array>>
, and no longer accepts a callback.Example:
import { getPixels, savePixels } from 'ndarray-pixels';
import fs from 'node:fs';
// read
const pixels = await getPixels(bytesIn, 'image/png'); // Uint8Array -> ndarray
// modify
for (let i = 0; i < pixels.shape[0]; ++i) {
for (let j = 0; j < pixels.shape[1]; ++j) {
pixels.set(i, j, 255);
}
}
// write
const bytesOut = await savePixels(pixels, 'image/png'); // ndarray -> Uint8Array
@donmccurdy can it be used with https://github.com/ericblade/quagga2/issues/494 ?
@houd1ni Yes, looking at the usage here...
... you'd just need to fetch the URL first (using fetch()
or some other library), then pass the Uint8Array or Buffer result into getPixels, which returns Promise<ndarray>
.
@dy - I see that request have been removed with this PR - https://github.com/scijs/get-pixels/pull/67 But the npm release still has the old code. Any plan on releasing the new package to npm? Would solve a lot of security issues reported by audit in our project
Hi! See https://github.com/ericblade/quagga2/issues/494