ty.
ty.

Reputation: 11132

Node gm - resize image and preserve aspect ratio?

Does Node gm have built-in support for resizing an image while preserving aspect ratio (ie., generating a thumbnail)? Or should I get the image size, calculate the proper ratio, and then call resize?

This question is inspired by PIL's similar functionality.

Upvotes: 3

Views: 5218

Answers (1)

ty.
ty.

Reputation: 11132

Jonathan's comment is the solution:

gm().resize(maxSize)

This resizes the image to width maxSize. See the relevant documentation.

Upvotes: 3

Related Questions