Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass arguments to getSignatureImage along to toDataURL #9

Closed
jokeyrhyme opened this issue Jun 8, 2011 · 10 comments
Closed

pass arguments to getSignatureImage along to toDataURL #9

jokeyrhyme opened this issue Jun 8, 2011 · 10 comments

Comments

@jokeyrhyme
Copy link
Contributor

After every update, I change the declaration of getSignatureImage like so:

,getSignatureImage: function() { return element.toDataURL.apply(element, arguments) }

This means I use getSignatureImage('image/jpeg') if I want JPEGs instead of everything being PNGs. This is still broken on certain Androids, but no more broken than it was before (I think).

It would be terrific if you incorporated this in the next update, as it is completely backwards-compatible.

@thomasjbradley
Copy link
Contributor

That works for me. I'll add it into the next update.

@clubnet
Copy link

clubnet commented Dec 4, 2012

api.getSignatureImage('image/jpeg')

Is returning png format

@thomasjbradley
Copy link
Contributor

That should work. What browser are you using? Does it support JPGs from ?

@clubnet
Copy link

clubnet commented Dec 4, 2012

I am using it on an android platform 4.0.4 with phonegap, everything else seems to work, I just need to have the file as jpeg so I can add it to pdf .

@thomasjbradley
Copy link
Contributor

Does Phonegap have an updated enough version of Webkit? I'm not fully sure how PhoneGap works, but I was under the impression that it had its own version of Webkit.

@clubnet
Copy link

clubnet commented Dec 7, 2012

It uses the devices native webview kit in this case android.webkit.WebView

@thomasjbradley
Copy link
Contributor

Does your code work outside PhoneGap in the Android native browser?

@clubnet
Copy link

clubnet commented Dec 18, 2012

it is a problem with android versions 4+ converting to jpeg, for those interested this is how you get around it

var imagepath = document.getElementById("signaturecanvas");
var encoder = new JPEGEncoder();
var imgData = encoder.encode(imagepath.getContext("2d").getImageData(0, 0, 589, 220), 100);
var jpegBase64Data = imgData.split(',')[1];
var jpegBinary = atob(jpegBase64Data);

However since upgrading to 4.1.2 the signature canvas seems to only draw straight lines and misses much of the input

@clubnet
Copy link

clubnet commented Dec 19, 2012

Any update on this, basically it is now unusable with an android device with the latest 4.1.2 os installed. Tested your demos with the native browser and got the same result

@thomasjbradley
Copy link
Contributor

@clubnet So, it's unusable because you can't get JPEGs? Will PNGs not do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants