File: max_bytes.rst

package info (click to toggle)
thumbor 7.7.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,556 kB
  • sloc: xml: 295,435; python: 18,673; ansic: 1,479; makefile: 360; sh: 27
file content (30 lines) | stat: -rw-r--r-- 700 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Max bytes
=========

Usage: `max\_bytes(number-of-bytes)`

Description
-----------

This filter automatically degrades the quality of the image until the
image is under the specified amount of bytes.

Arguments
---------

- ``number-of-bytes`` - The maximum number of bytes for the given image.

Example
-------

Compressing the original image to less than 7.5k (ended up with ~7kb):

.. image:: images/tom_before_brightness.jpg
    :alt: Picture before the max_bytes filter

::

    http://localhost:8888/unsafe/filters:max_bytes(7500)/https%3A%2F%2Fgithub.com%2Fthumbor%2Fthumbor%2Fraw%2Fmaster%2Fexample.jpg

.. image:: images/tom_after_max_bytes.jpg
    :alt: Picture after 7500 max_bytes filter