ccorcos / meteor-clientside-image-manipulation

A clientside javascript library for manipulating images before uploading. Specifically, resizing and adjusting for image orientation.
43 stars 4 forks source link

TypeError: Image is not a function on Chrome 42 #10

Closed byrne-yan closed 9 years ago

byrne-yan commented 9 years ago

TypeError: Image is not a function at processImage (ccorcos_clientside-image-manipulation.js:958)

byrne-yan commented 9 years ago
  canvas = document.createElement('canvas');                                                // 956
  ctx = canvas.getContext("2d");                                                            // 957
  img = new Image();                                                                        // 958
  url = (window.URL ? window.URL : window.webkitURL);                                       // 959
  img.src = url.createObjectURL(imageFile);                                                 // 960
  return img.onload = function(e) {             
ccorcos commented 9 years ago

You probably redefined Image to be something else. Its a native object. Open up your console on this webpage and try it.

byrne-yan commented 9 years ago

The issue found on meteor android with crosswalk. image

byrne-yan commented 9 years ago

Image() constructor is just a recommendation for HTML5 W3C. Is there any workaround on browser that don't support Image()?

byrne-yan commented 9 years ago

Solved. It is caused by one of my meteor package which exports Image. Thanks for your tips!

ccorcos commented 9 years ago

Haha well there you go!

Sent from my iPhone

On Sep 13, 2015, at 00:09, byrne-yan notifications@github.com wrote:

Solved. It is caused by one of my meteor package which exports Image. Thanks for your tips!

— Reply to this email directly or view it on GitHub.