brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
690 stars 529 forks source link

Corrupted signature images on mobile app #170

Open SeanB79 opened 5 years ago

SeanB79 commented 5 years ago

Thanks for a great component.

We are having an issue where a small % of signatures collected are coming out corrupted. Our code is: var pic = $sigdiv.jSignature("getData", "image"); app.trigger('extif:saveSignatureFile', 'rngNameOfFile', pic[1]); extif:saveSignatureFile then writes that data to the device as a file

We then call $sigdiv.jSignature("getData", "svg"); to get the svg version and use that to send to the server to be added to the pdf file.

Both the image file and the pdf are showing the corrupted image. The trigger of this code is on a button click after the signature has been captured. We are running the app on Samsung tab 10 Android 7.0 devices.

Samples of image files: 1_905399_1_closingphoto2 905334_1_closingphoto1 905495_1_closingphoto1

brianrichins commented 4 years ago

This looks like the SVG data is being saved to image as individual points, instead of as the bezier (I presume) curves which are defined by those points. Inspect the results of getData and pass them into an SVG validator to see if the corruption is happening during extraction or during the save process.

Can you isolate the devices experiencing the issue and see if they happen to have a different drawing SDK, or anything else needed in the extif:saveSignatureFile implementation?