django-cms / djangocms-bootstrap4

django CMS Bootstrap 4 is a plugin bundle for django CMS providing several components from the popular Bootstrap 4 framework.
https://www.django-cms.org/
Other
82 stars 58 forks source link

Thumbnails in a carousel #37

Closed serjflint closed 5 years ago

serjflint commented 6 years ago

I created default carousel. Then I insert carousel slides in it. Pictures in slides are really wide so it is easy to notice any changes. But I got upscaled thumbnails instead of my original pictures. How to put pictures in the carousel as is?

vxsx commented 5 years ago

Carousel uses aspect ratios to create thumbnails for images so that all of them are uniform:

screen shot 2018-07-09 at 06 40 04

If no aspect ratio is speicified it uses default size for images, which is 1024x768, unless the parent template is wrapped with

{% with 1000 as width and 400 as height %}

https://github.com/divio/djangocms-bootstrap4/blob/fa1be206f432aa81535da3aef2d231c86ca25e85/djangocms_bootstrap4/contrib/bootstrap4_carousel/constants.py#L30

The easiest solution is to either pick aspect ratio that fits or modify the template to use original pictures. The plugin provides template option for that.

mateoreyes commented 5 years ago

how do I modify the template so that it uses the original sizes of the images ?