Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
const os = require("os");
const http = require("http");
const ms = require("milsymbol");
const Canvas = require("canvas-prebuilt"); // switch to canvas when node-pre-gyp follows redirects
// const Canvas = require("canvas"); // switch to canvas when node-pre-gyp follows redirects
const { createCanvas, loadImage } = require('canvas')
const url = require("url");
const hostname = os.hostname();
const bindAddress = process.env.BIND_ADDRESS || "0.0.0.0";
Expand All @@ -12,7 +13,7 @@ ms.Symbol.prototype.asNodeCanvas = function() {
const MAX_SIZE = 2000; // Maximum width/hight for the canvas to aviod out of memory
ms._brokenPath2D = true; // Make it use our custom polyfill for Path2D
const ratio = 1;
const canvas = new Canvas(
const canvas = createCanvas(
Math.min(this.width, MAX_SIZE),
Math.min(this.height, MAX_SIZE)
);
Expand Down
Loading