Closed roblav96 closed 8 years ago
Hi,
you are missing the imageDataType. So it is trying to read a URL. You also have resizeType a but wrong (should be either pixel or factor) here is a corrected version that should work.
var canvasurl = canvas.toDataURL( "image/jpeg" )
window.imageResizer.resizeImage( function ( data ) {
var imgg = "data:image/jpeg;base64," + data.imageData;
console.log( 'imgg >', imgg )
}, function ( error ) {
console.log( "Error : \r\n" + error );
}, canvasurl, 0.5, 0.5, {
resizeType: ImageResizer.RESIZE_TYPE_FACTOR,
imageDataType: ImageResizer.IMAGE_DATA_TYPE_BASE64,
format: ImageResizer.FORMAT_JPG
} )
Ah. That would make sense. I was trying to follow the example on the readme.md but it didn't provide enough details. Thank you!!
Yeah, my fault :-) Just updated the readme.
Sweet! Sounds good. I'm gonna try it out now. Thank you!
Still not working :/
var canvasurl = canvas.toDataURL( "image/jpeg" )
console.log( 'canvasurl >', canvasurl )
window.imageResizer.resizeImage( function ( data ) {
var imgg = "data:image/jpeg;base64," + data.imageData
console.log( 'imgg >', imgg )
}, function ( error ) {
console.error( "window.imageResizer.resizeImage > " + error )
}, canvasurl, 0.5, 0.5, {
resizeType: ImageResizer.RESIZE_TYPE_FACTOR,
imageDataType: ImageResizer.IMAGE_DATA_TYPE_BASE64,
format: ImageResizer.FORMAT_JPG,
quality: 100
} )
var canvasurl =
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMD…B1GK9M0fU472Ffm/OvmMbgpYWemqPeyvNPbNUK3xdH3NWijIPSiuLc94KayBuo+lOopNCsf//Z
the console.log is truncating the url. If you need the whole thing I can get it.
I think I need to change it to base64.
EDIT Still nothing.
Issue reopened :-) What error are you getting? still the same exception?
I'm in class right now, but I just got it working after clean installing my app. Strange. lol Thank you!!!
I get an instant crash of my app when trying to use this plugin.
Logcat:
How's she lookin?
Here's my code: