Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

resize

  • Loading branch information...
commit ca2f9842776e0e273f3e89227420e3a6bcedd06b 1 parent 08c1a48
TJ Holowaychuk authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 test
19 test
View
@@ -1,10 +1,23 @@
#!/usr/bin/env node
var palette = require('./')
- , canvas = require('canvas')
- , path = process.argv[2];
+ , Canvas = require('canvas')
+ , Image = Canvas.Image
+ , canvas = new Canvas
+ , ctx = canvas.getContext('2d')
+ , path = process.argv[2]
+ , out = '/tmp/out.png';
if (!path) {
console.error('Usage: test <image>');
process.exit(1);
-}
+}
+
+var img = new Image;
+
+img.onload = function(){
+ canvas.width = img.width;
+ canvas.height = img.height;
+};
+
+img.src = path;
Please sign in to comment.
Something went wrong with that request. Please try again.