intendednull / dm-toolkit

Native management tool for tabletop rpgs
0 stars 0 forks source link

Resolving image scales #17

Open CLyonsDev opened 5 years ago

CLyonsDev commented 5 years ago

We are going to want to make sure a maximum image size is set for all of our uploadable images.

If an image is supposed to be 256x256 but the user uploads an image with a resolution of 1024x1024, we want to shrink the image to fit those dimensions instead of expanding the image's frame.

The image should also preserve aspect ratio. If I upload an image that is 1024x512, that image should probably shrink down to 256x64.

intendednull commented 5 years ago

We can use image-rs for scaling. It preserves aspect ratio by default so it works out nicely.