diff options
| author | Lars Ingebrigtsen | 2017-07-15 02:45:19 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2017-07-15 02:48:17 +0200 |
| commit | ae56c9674b4668ded392c66d46aa22db902ddd71 (patch) | |
| tree | 3472b1e2c5877ee37a0b4813f60bc2b2b5515d47 /doc | |
| parent | 89c5d59280edaf89b959597a39d848b54c36975a (diff) | |
| download | emacs-ae56c9674b4668ded392c66d46aa22db902ddd71.tar.gz emacs-ae56c9674b4668ded392c66d46aa22db902ddd71.zip | |
Make combinations of :width/:max-height image specs work reliably
* doc/lispref/display.texi (ImageMagick Images): Document
:width/:max-height combinations (etc) (bug #25583).
* src/image.c (compute_image_size): Handle :width/:max-height
(etc) combinations consistently (by letting "max" win and
preserve ratio).
* test/manual/image-size-tests.el (image-size-tests): Add
tests for :width/:max-height (etc) combinations.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/display.texi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 005d31af05a..98940cbc996 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -5305,6 +5305,17 @@ and if @code{:height} is set it will have precedence over | |||
| 5305 | wish. @code{:max-width} and @code{:max-height} will always preserve | 5305 | wish. @code{:max-width} and @code{:max-height} will always preserve |
| 5306 | the aspect ratio. | 5306 | the aspect ratio. |
| 5307 | 5307 | ||
| 5308 | If both @code{:width} and @code{:max-height} has been set (but | ||
| 5309 | @code{:height} has not been set), then @code{:max-height} will have | ||
| 5310 | precedence. The same is the case for the opposite combination: The | ||
| 5311 | ``max'' keyword has precedence. That is, if you have a 200x100 image | ||
| 5312 | and specify that @code{:width} should be 400 and @code{:max-height} | ||
| 5313 | should be 150, you'll end up with an image that is 300x150: Preserving | ||
| 5314 | the aspect ratio and not exceeding the ``max'' setting. This | ||
| 5315 | combination of parameters is a useful way of saying ``display this | ||
| 5316 | image as large as possible, but no larger than the available display | ||
| 5317 | area''. | ||
| 5318 | |||
| 5308 | @item :scale @var{scale} | 5319 | @item :scale @var{scale} |
| 5309 | This should be a number, where values higher than 1 means to increase | 5320 | This should be a number, where values higher than 1 means to increase |
| 5310 | the size, and lower means to decrease the size. For instance, a value | 5321 | the size, and lower means to decrease the size. For instance, a value |