Skip to content

Unable to load image form UInt8Array. I get this error: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received Uint8Array(6191) #89

@adnanlah

Description

@adnanlah

Hello,

I tried to load an image from a base64 data this way:

const buffer = Buffer.from(logo, 'base64')
const uint8Array = new Uint8Array(buffer)
const image = await Image.load(uint8Array)
printer = await printer.image(
    image,
    's8' // changing with image
)

but I get this error:

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received Uint8Array(6191)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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