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

FromDataURL reducing image size #105

Closed
rmmackay opened this issue May 15, 2015 · 7 comments
Closed

FromDataURL reducing image size #105

rmmackay opened this issue May 15, 2015 · 7 comments

Comments

@rmmackay
Copy link

Hello,

If I save a signature to a database using the toDataURL() function, and then I load that string back into the canvas using the fromDataURL() function, then the resulting image appears in the canvas but is noticeably smaller than the original image.

To test, draw in the canvas along all 4 edges. Save and then reload. You will see that the right-side and bottom-sides of the image now have space between the image and the border because the image was made slightly smaller.

Since I re-save images over and over for a good reason, they keep shrinking with each save!!!

Help!

@razvanphp
Copy link

Hmm, this happens only on Retina Display, I just reproduced it. You must deal with it yourself somehow, the creator said already multiple times that the library should not take care of this.

@razvanphp
Copy link

It seems that this solves the problem:
http://jsfiddle.net/4JH75/19/

@Mottoweb
Copy link

Mottoweb commented Dec 2, 2015

I am experiencing the same issue with device pixel ratio 1. Any help?

@szimek szimek added this to the 2.0 milestone Dec 30, 2015
@durasj
Copy link

durasj commented Jun 17, 2016

Related to #153

@demo-igor
Copy link

To make the same image size you can add options
signaturePad.fromDataURL(data, {width: 100, height: 100})
width, height should be the same as canvas size
More details:
https://github.com/szimek/signature_pad/blob/master/src/signature_pad.ts

@iDevIt007
Copy link

Thanks to your last answer, we can now fix the problem with fromDataURL scaling issues, should close this issue.

@pavankumar0425
Copy link

Thanks a lot for the response "demo-igor"

@szimek szimek closed this as completed Jan 5, 2020
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

8 participants