scottcheng / cropit

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

Cropit export base64 transparent image in 0.4.1 #93

Closed felipekoblinger closed 8 years ago

felipekoblinger commented 9 years ago

Hello! I don't know why but in 0.4.1 when I use cropit('export')it gives an empty transparent image base64. It always the same base64 for any image I try :)

Works normal in 0.4.0.

Tested with this jQuery code:

$('#image-cropper').cropit('export'))
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAAAXNSR0IArs4c6QAAAaFJREFUeAHt0DEBAAAAwqD1T20LL4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQO/gQFgNQAB6po22QAAAABJRU5ErkJggg=="

Sorry if I'm making any mistake.

Thanks

scottcheng commented 9 years ago

That's weird. Do the demos work for you?

meiram-tr commented 9 years ago

also happen to me on ios devices with version 0.4.1, it happens a lot but didn't figure reason. event for the same image, sometimes it is do the work and some times it returns transparent image.

scottcheng commented 9 years ago

Yes I was able to reproduce it in Mac Safari and iOS Safari the first time the page loads. After a refresh it works fine. Very strange. Let me look into this.

clari100 commented 8 years ago

Hi - I am also experiencing this problem - but the image remains transparent even after a refresh.

scottcheng commented 8 years ago

I had to fix this by removing a quality optimization. If image quality is a concern, you can use cropit only for the cropping UI, send the crop box data to the server, and do the cropping/resizing using a server-side tool.

jan-vallo commented 8 years ago

I experienced the same issue on 0.4.1 (it happened randomly), so I updated cropit to 0.4.5, but it still happens, my image always gets resized to the correct size, but sometimes cropit returns empty png image with no background, for now I will try to implement server side cropping

chaitu0293 commented 7 years ago

transaparent image is not working with your plugin is it correct?