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

typo in README #133

Open
jftuga opened this issue Nov 23, 2020 · 1 comment
Open

typo in README #133

jftuga opened this issue Nov 23, 2020 · 1 comment

Comments

@jftuga
Copy link

jftuga commented Nov 23, 2020

under the FAQ you have:

The stadard image/* packages do not...

standard is misspelled.


Also what is the difference between Resize() and Fit()?

@disintegration
Copy link
Owner

Thank you! Fixed it.

  • Fit preserves the aspect ratio of the original image. It resizes the image only if its size is larger than the given bounding box, i.e. it may only downscale the image.
  • Resize on the other hand always changes the image size to the exact size requested. If one of the given dimensions is zero, it also preserves the original aspect ratio. It may be used both for upscaling and downscaling.

E.g.

Original image is 400x200 px.

Fit(img, 100, 100, ...) returns 100x50 px image.
Fit(img, 1000, 1000, ...) returns 400x200 px image (unchanged).

Resize(img, 100, 100, ...) returns 100x100 px image.
Resize(img, 100, 0, ...) returns 100x50 px image.
Resize(img, 0, 100, ...) returns 200x100 px image.
Resize(img, 1000, 1000, ...) returns 1000x1000 px image.

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

2 participants