Skip to content

canvas.loadImage(src) got exception "Out of memory" #1735

@VIIGstar

Description

@VIIGstar

Issue or Feature

Hi, I had trouble with load image by canvas that always got out of memory exception.
My device still can load image has size larger than 80MB without any problem except this image (16.8MB) https://pbimg.btdmp.com/pbase/shop-id/10117363/artworks/2141699b41cb8b5b454ffbd0380e247b.png

Steps to Reproduce

const _canvas = require('canvas')

_canvas.loadImage('https://pbimg.btdmp.com/pbase/shop-id/10117363/artworks/2141699b41cb8b5b454ffbd0380e247b.png')
    .catch((e) => {
      console.log(e)
  })

Exception:

Error: out of memory
    at setSource (/home/beeketing/code/front/print-2d-render/node_modules/canvas/lib/image.js:91:13)
    at get.concat (/home/beeketing/code/front/print-2d-render/node_modules/canvas/lib/image.js:59:11)
    at concat (/home/beeketing/code/front/print-2d-render/node_modules/simple-get/index.js:89:7)
    at IncomingMessage.<anonymous> (/home/beeketing/code/front/print-2d-render/node_modules/simple-concat/index.js:8:13)
    at Object.onceWrapper (events.js:273:13)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Your Environment

  • Version of node-canvas: 2.6.1
  • Environment: Node v10.13, Ubuntu 18.04.4 LTS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions