brinley / jSignature

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

Base64ToNative issue #81

Closed mvalent23 closed 9 years ago

mvalent23 commented 9 years ago

After trying to reconstruct and render a raster image from the base30 compressed image strokes using the Base64ToNative() tool in the PHP extras, I came across an issue. A post on StackOverflow helped me identify what was going wrong: http://stackoverflow.com/questions/22332920/first-letter-of-jsignature-capture-rendering-incorrectly/29058148#29058148

It appears that in the PHP tool, the first stroke of the reconstructed native data does not decompress correctly. I'm not sure if I'm our assumptions about the tool are incorrect or not, but as part of the workaround solution, I just added a "dummy" stroke to the compressed image by pre-pending "AA" to the image data before decompression. After doing this, when rendering, I just skip the first stroke (the dummy stroke) and everything appears to render correctly.

While the workaround is sufficient for now, it's still a hack. I just wanted to report the issue so hopefully it will be fixed in future releases.

mvalent23 commented 9 years ago

Ignore. It appears I was actually handling the image data incorrectly after getting some sleep, having some coffee, and realizing I'm a dunce for trying to decompress the "image/jSignature;base30," as part of the stroke....