Skip to content

Path must be a string, received {255.....} #61

Description

@thomascouto

Hello, I'm trying to use get-pixels with Uint8array, but I'm stuck in this error.

TypeError: Path must be a string. Received {"0":255,"1":216,"2":255,"3":224,"4":0,"5":16,"6":74,"7":70,"8":73,"9":..........................255}

Types:
declare function getPixels(path: string | Uint8Array, type: string, callback: Callback): void

Test code:
const arr = new Uint8Array(path);

console.log(arr); //is a Uint8array

getPixels(arr, 'image/jpg', (err, pixels) => {
console.log(pixels);
});

Any suggestions ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions