scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 304 forks source link

cropit giving me an about:blank page in Chrome #282

Open Lxxrxns opened 6 years ago

Lxxrxns commented 6 years ago

Hi Scott,

I'm trying to use cropit, but I'm having an issue. Clicking on the "Download cropped image" button, even on your own demo page, gives me a new tab with about:blank, but doesn't give me any data or base64 image. Just a blank page.

Is it something with my browser? Or is your demo page no longer working? I'm experiencing the same issue when I try to use cropit on my own web page.

Kind regards,

Laurens

Lxxrxns commented 6 years ago

Of note: in firefox it works just fine!

mrs-orangetree commented 6 years ago

same here.

pproulx89 commented 6 years ago

Hey everyone! I think the issue is how Chrome handles the window.open(imageData); line of code.

Replace the example export JQuery function with the following to get it to work on Chrome: $('.export').click(function() { var imageData = $('.image-editor').cropit('export'); var image = new Image(); image.src = imageData; var w = window.open(""); w.document.write(image.outerHTML); });