kyranet / canvas-constructor

An ES6 utility for canvas with built-in functions and chained methods.
https://canvasconstructor.js.org
MIT License
116 stars 23 forks source link

bug: printImage #366

Closed hansputera closed 4 years ago

hansputera commented 4 years ago

Describe the bug

.printImage can't be use

To Reproduce

  1. Write code
  2. Click on code
  3. See error

Expected behavior

TypeError: Image or Canvas expected
    at s.printImage (/rbd/pnpm-volume/2f64482c-fc3c-4c68-a1b6-c0cede80decf/node_modules/.registry.npmjs.org/canvas-constructor/4.1.0/node_modules/canvas-constructor/dist/index.js:1:3866)
at oke (/app/src/commands/core/instagram.js:23:8)
at Object.exports.run (/app/src/commands/core/instagram.js:56:72)
    at processTicksAndRejections (internal/process/task_queues.js:88:5)
kyranet commented 4 years ago

You're giving printImage a buffer, please go to the official server (in this repository's README) and provide the code, so we can help you.

Essentially, it doesn't accept buffers, you need to replace whatever you use to fetch the image, with either loadImage from canvas or resolveImage from canvas-constructor