docs icon indicating copy to clipboard operation
docs copied to clipboard

proportional resizing of images not working as described in docs

Open znegva opened this issue 8 years ago • 0 comments

The docs at https://docs.bolt.cm/3.2/templating/templatetags#image state:

To scale an image proportionally to a given width or height, set the other dimension to null, and set cropping mode to resize.

<img src="{{ content.image|image(400, null, "r") }}">

This is not working for me, it creates proportional images/thumbs of height 120px. (120px is my default thumbnail-height in config.yml) The image is places in /thumbs/400x120r/filename.thumb.jpg

The expected behaviour can be achieved by using:

<img src="{{ content.image|image(400, 0, "r") }}">

(replacing null with 0) That creates a proportional image of width 400px which is placed in /thumbs/400x0r/filename.thumb.jpg

So either the docs should be updated or the image() and thumbnail() function should check for null

Details

  • Relevant Bolt Version: 3.2.12
  • Install type: Zip/tarball install
  • PHP version: 5.6.30
  • Used web server: Apache/2.4.25 (Unix)

znegva avatar Jun 15 '17 17:06 znegva