yeahdongcn / RSBarcodes

1D and 2D barcodes scanner and generators for iOS7 with delightful controls.
MIT License
383 stars 59 forks source link

Scaled up 2D codes to prevent blurriness #20

Closed guilhermearaujo closed 10 years ago

guilhermearaujo commented 10 years ago

If you generate a QR code with a short content string, the resulting image will have small dimensions.

For instance, I generated a code using a 20 character string as content, and the image returned was 27x27 pixels. I wanted to display it on a 300x300 view, so it ended up very blurred.

To prevent it, all the 2D codes are now scaled by a factor of 15x. This way, the image will be downscaled when shown, and the quality will be preserved.

Here's a before and after comparison: http://cl.ly/image/3W0k2F2k181F

yeahdongcn commented 10 years ago

You should use static inline UIImage resizeImage(UIImage source, float scale) to scale the image with expected scale value. This modification is not so general, so I'm afraid I can't take this PR.