Replies: 4 comments
-
The behaviour matches what’s in libvips’ documentation:
So the ruby-vips documentation should clarify that width doesn’t just constrain the width but also the hight unless its set to something else. |
Beta Was this translation helpful? Give feedback.
-
Hello @da2x, The ruby-vips docs are generated automatically by introspection of the libvips class hierarchy, so it's not easy to edit them, unfortunately. There's been talk of generating them from the It's actually pretty easy -- https://gist.github.com/jcupitt/eef9d24d19d345da6dccbb8e569951c7 Has this for `thumbnail`:
The doc node has a pretty strict format, so it should be easy to turn to markdown etc. You just need to load that xml and generate something better than this: https://github.com/libvips/ruby-vips/blob/master/lib/vips/methods.rb#L2002 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It's too big for a gist -- you have to press "download" to see the whole thing. If you build libvips from source the file is generated for you locally, of course. It's using yard. The current generator is here: Of course that's done with introspection rather than from the You'd need to reformat the
|
Beta Was this translation helpful? Give feedback.
-
The second parameter to
Image.thumbnail
is documented as a constraint to the width. However, it constrains the largest dimension of the image and not just the width (as the name implies).Example:
The resulting image is 533x600 px instead of 600x675 px as expected.
Beta Was this translation helpful? Give feedback.
All reactions