[Signature Pad] Avoid a "dot" signature

Forge Component
(7)
Published on 2019-10-02 by Labs
7 votes
Published on 2019-10-02 by Labs

Can we set a minimum signature length? To avoid someone just adding a dot for example?

Hi Robert,

I don't think that is something you easily can achive. But how could you ever check if the signature is correct. One could give a fake signature, write X or whatever. You can only easily check if a signature is not given.

Isn't it the case that someone is asking a person for a signature, and visually checks that a proper signature is given?

Regards,

Daniel

Thanks Daniel. In our use case - the signature is not visually checked. 

It's not a deal breaker that a "dot" or an "x" cannot be avoided - it would be more of a nice to have. A dot would more likely be added by mistake - with the user continuing the process, rather than somebody scribbling an "X".

Therefore maybe a minimum length would be a cool feature!

Many thanks.

Robert

I think what could work if you find the boundaries of the signature and than some minumum you expect it to be.

Alternatively you could go through every pixel of the image and count how many are not white (if that is your background color). Than use a minimum threshold of pixels that should not be white. Here is some example code (working javascript example at the bottom of the page: https://stackoverflow.com/questions/47608864/find-specific-color-in-image/47618828

Either way, it is not a simple problem to solve.



That is very interesting, there is always a way!

I might try the JavaScript example when the chance comes, never knew it was possible to count pixels in an image like that.

Thanks again,

Robert