thumbor package to generate URLs in Java
Java
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
downloads
lib
src/com/globo/thumbor
.gitignore
README.mkd
manifest.mf

README.mkd

thumbor-enterprise-edition is deprecated in favor of Pollexor

Introduction

Thumbor Enterprise Edition (a.k.a thumborEE) is a library to generate encrypted thumbor URLs.

In order to use it, just download the latest version from the listed versions below in the Downloads section of the readme file and add it to your project.

Usage

Using thumborEE is pretty simple, all you have to do is create a CryptoURL instance with the proper key and original image URL and start customizing it.

CryptoURL crypto = new CryptoURL('my-security-key', 'http://my.server.com/path/to/my/image.jpg');
System.out.println(crypto.resize(300, 200).withSmartCropping().toString());
// /l42l54VqaV_J-EcB5quNMP6CnsN9BX7htrh-QbPuDv0C7adUXX7LTo6DHm_woJtZ/my.server.com/some/path/to/image.jpg

Available Options

For more information on what each option means don't forget to check thumbor's documentation.

metaDataOnly

Tells thumbor to return metadata instead of the actual image.

Usage: crypto.metaDataOnly()

withSmartCropping

Tells thumbor to use smart cropping (Face and Feature Recognition).

Usage: crypto.withSmartCropping()

resize

Changes the target width and height for the generated image.

Usage: crypto.resize(width, height)

PS: if one of the dimensions (width or height) is zero, proportional dimension is applied. If both are zero, original image is returned.

fitIn

Tells thumbor that the specified image must fit in the given box (defined by width x height).

Usage: crypto.fitIn(width, height)

align

Tells thumbor to crop based on a given alignment (Left, Center, Right, Top, Middle, Bottom). For more info, check thumbor's documentation.

Usage: crypto.align(CryptoURL.HAlign.LEFT, CryptoURL.VAlign.TOP); Or: crypto.align(CryptoURL.HAlign.LEFT); Or: crypto.align(CryptoURL.VAlign.TOP);

PS: If you supply only one alignment, the default is assumed for the other one.

crop

Specifies the bounding points that tell thumbor where to manually crop the image.

Usage: crypto.crop(left, top, right, bottom);

withFilter

Tells thumbor to use this filter. Can be called multiple times to specify different filters.

Usage: crypto.withFilter("quality(20)").withFilter("round_corner(3,255,255,255)")

Downloads

License

Thumbor is licensed under the MIT License:

The MIT License

Copyright (c) 2011 Bernardo Heynemann heynemann@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.