diff --git a/unpack-browser.js b/unpack-browser.js
index <HASH>..<HASH> 100644
--- a/unpack-browser.js
+++ b/unpack-browser.js
@@ -6,12 +6,12 @@ var ndarray = require("ndarray")
 
 function unpackPNG(w, h, c, str) {
   var canvas = document.createElement("canvas")
-  canvas.width = w
-  canvas.height = h
+  canvas.width = h
+  canvas.height = w
   var img = new Image()
   img.src = "data:image/png;base64," + str
   var context = canvas.getContext("2d")
   context.drawImage(img, 0, 0)
-  var pixels = context.getImageData(0, 0, w, h)
+  var pixels = context.getImageData(0, 0, h, w)
   return ndarray(pixels.data, [h, w, c], [4*w, 4, 1], 0)
 }
\ No newline at end of file
Fix image orientation in unpack-browser.js

width/height were reversed :)