]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/image_rescaling_distorts_with_small_pictures.mdwn
clarify which case fails
[ikiwiki.git] / doc / bugs / image_rescaling_distorts_with_small_pictures.mdwn
1 If you use the rescaling feature of the directive [[ikiwiki/directive/img/]] with a smaller image it will distort. E.g. an image with 150x250 rescaled into size=200x200. --bastla
2
3 > More specifically: `img` normally preserves aspect ratio:
4 > `size=200x200` normally means "as large as possible, keeping
5 > the width 200px or less, the height 200px or less, and the
6 > aspect ratio correct". So a 4:3 image with `size=200x200`
7 > would actually come out 200px wide and 150px tall.
8 >
9 > However, when (desired width is specified) && (desired height is specified)
10 > && ((width > desired width) || (height > desired height)),
11 > it uses exactly the desired size, without preserving aspect ratio.
12 > --smcv