scottcheng / cropit

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

sometimes fails to load image.image loaded as a white blank area #123

Open Geethikamanat opened 8 years ago

Geethikamanat commented 8 years ago

sometimes fails to load image. when export image ,image loaded as a white blank area

jpouillard commented 8 years ago

Hello, Same problem for me : when i crop a picture, sometimes, the picture URL looks like :

data:image/jpeg;base64,/9j/4AAQSkZJRgAB....AxEAPwD+/igAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAK...

Note the repetitive "AKACgAoAKo" pattern !

Something is going wrong with the export URL, maybe in canvas / context method...

jpouillard commented 8 years ago

Bug found in the preresizeImage method : you must add exportOptions.type and exportOptions.quality parameters to the canvas.toDataURL method. (version 0.4.0)

jacobsauerhoefer commented 8 years ago

@jpouillard @geethikamanat

Hey guys! I was experiencing a similar issue with blank images and a broken data url, turns out it had to do with canvas's .toDataURL method (thanks for the hint @jpouillard ) and memory limitations when exporting. Before applying cropit, reducing the image dimensions using an image processor seems to have done the trick. Try using a size smaller than 1000px and fine tune it from there. Cheers!

jpouillard commented 8 years ago

Hi, problem solved for me with the last version. Nice tool ;)