diff --git a/package.json b/package.json index 0902eb6..473374b 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,6 @@ "dependencies": {}, "devDependencies": { "browserify": "^12.0.1", - "canvas": "^1.3.5" + "canvas": "^2.6.1" } } diff --git a/test/canvas.js b/test/canvas.js index cbf547c..826042d 100644 --- a/test/canvas.js +++ b/test/canvas.js @@ -1,7 +1,7 @@ "use strict"; var PNGReader = require('../PNGReader'); -var Canvas = require('canvas'); +var {createCanvas} = require('canvas') var fs = require("fs"); var out = fs.createWriteStream(__dirname + '/test.png'); @@ -20,7 +20,7 @@ fs.readFile(file, function(err, bytes){ console.log('bitDepth', png.bitDepth); console.log('colors', png.colors); - var canvas = new Canvas(png.width, png.height); + var canvas = createCanvas(png.width, png.height); var ctx = canvas.getContext('2d'); var stream = canvas.createPNGStream();