Skip to content

Its possible resize just one dimension of image? #103

Closed Answered by kipcole9
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Image.resize/2 is a scaling function and probably not what you're after.

I would recommend using Image.thumbnail/3 with something like Image.thumbnail(my_image, "200x400"). Or if you want to keep the aspect ratio of the image Image.thumbnail(my_image, 400) will ensure the longest side is 400px and the shortest size is resized to keep the aspect ratio.

There are a lot of other options to Image.thumbnail/3 so let me know if you have any other questions.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant