<commit_before>Usage
=====

Using thumbor is really straightforward. thumbor offers one endpoint for
retrieving the image and a very similar endpoint to retrieve metadata.

Image Endpoint
--------------

    **http://\ *thumbor-server*/hmac/trim/AxB:CxD/fit-in/-Ex-F/HALIGN/VALIGN/smart/filters:FILTERNAME(ARGUMENT):FILTERNAME(ARGUMENT)/*image-uri***

-  *thumbor-server* is the address of the service currently running;
-  hmac is the signature that ensures doc:`security` ;
-  trim removes surrounding space in images using top-left pixel color
   unless specified otherwise;
-  AxB:CxD means manually crop the image at left-top point AxB and
   right-bottom point CxD;
-  fit-in means that the generated image should not be auto-cropped and
   otherwise just fit in an imaginary box specified by ExF;
-  -Ex-F means resize the image to be ExF of width per height size. The
   minus signs mean flip horizontally and vertically;
-  HALIGN is horizontal alignment of crop;
-  VALIGN is vertical alignment of crop;
-  smart means using smart detection of focal points;
-  filters can be applied sequentially to the image before returning;
-  *image-uri* is the public URI for the image you want resized.

Trim
~~~~

Removing surrounding space in images can be done using the trim option.

Unless specified trim assumes the top-left pixel color and no tolerance
(more on tolerance below).

To use it, just add a ``/trim`` part to your URL.

If you need to specify the orientation from where to get the pixel
color, just use ``/trim:top-left`` for the top-left pixel color or
``/trim:bottom-right`` for the bottom-right pixel color.
<commit_msg>Update usage.rst<commit_after>Usage
=====

Using thumbor is really straightforward. thumbor offers one endpoint for
retrieving the image and a very similar endpoint to retrieve metadata.

Image Endpoint
--------------

    **http://\ *thumbor-server*/hmac/trim/AxB:CxD/fit-in/-Ex-F/HALIGN/VALIGN/smart/filters:FILTERNAME(ARGUMENT):FILTERNAME(ARGUMENT)/*image-uri***

-  *thumbor-server* is the address of the service currently running;
-  hmac is the signature that ensures :doc:`security` ;
-  trim removes surrounding space in images using top-left pixel color
   unless specified otherwise;
-  AxB:CxD means manually crop the image at left-top point AxB and
   right-bottom point CxD;
-  fit-in means that the generated image should not be auto-cropped and
   otherwise just fit in an imaginary box specified by ExF;
-  -Ex-F means resize the image to be ExF of width per height size. The
   minus signs mean flip horizontally and vertically;
-  HALIGN is horizontal alignment of crop;
-  VALIGN is vertical alignment of crop;
-  smart means using smart detection of focal points;
-  filters can be applied sequentially to the image before returning;
-  *image-uri* is the public URI for the image you want resized.

Trim
~~~~

Removing surrounding space in images can be done using the trim option.

Unless specified trim assumes the top-left pixel color and no tolerance
(more on tolerance below).

To use it, just add a ``/trim`` part to your URL.

If you need to specify the orientation from where to get the pixel
color, just use ``/trim:top-left`` for the top-left pixel color or
``/trim:bottom-right`` for the bottom-right pixel color.

{'fraction_non_alphanumeric': 0.08090024330900243, 'fraction_numerical': 0.0, 'mean_word_length': 3.829662261380323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7340556', 'n_tokens_mistral': 910, 'n_tokens_neox': 890, 'n_words': 441}