Added documentation for quality parameter

Added documentation for quality parameter for thumbnail()
This commit is contained in:
Dr. Tarique Sani 2016-11-21 10:36:27 +05:30 committed by GitHub
parent a92cc8caf6
commit 6414ed8f2c
1 changed files with 9 additions and 1 deletions

View File

@ -4,7 +4,7 @@ summary: Creates a thumbnail for an image.
--- ---
type: method type: method
--- ---
signature: width, height=None, crop=False signature: width, height=None, crop=False, quality=None
--- ---
body: body:
@ -17,6 +17,8 @@ given reactangle of width and height. If height is not specified it will
match the width and the height is set accordingly. If cropping is enabled match the width and the height is set accordingly. If cropping is enabled
it's cropped around the edges to fit into the center. it's cropped around the edges to fit into the center.
Quality parameter determines the compression of images where possible. If not passed the jpeg images get a default quality of 85 and png images get a default quality of 75.
It provides the following attributes: It provides the following attributes:
* `width`: the thumbnail width in pixels. * `width`: the thumbnail width in pixels.
@ -34,3 +36,9 @@ to the exact dimensions provided instead of scaling it uncropped.
<img src="{{ image.thumbnail(64)|url }}"> <img src="{{ image.thumbnail(64)|url }}">
{% endfor %} {% endfor %}
``` ```
```html+jinja
<img src="{{ image.thumbnail(1920, 1080, crop=True, quality=40)|url }}">
```