Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
ruby-thumbor is the client library to thumbor.
Branch: master
Pull request Compare This branch is 82 commits behind thumbor:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
script
spec
tasks
.gitignore
.rspec
.travis.yml
Gemfile
Gemfile.lock
History.txt
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile
install-python.sh
requirements
test_requirements.txt

README.rdoc

ruby-thumbor Build Status

DESCRIPTION:

ruby-thumbor is the client to the thumbor imaging service (github.com/globocom/thumbor).

FEATURES:

  • Generate thumbor encrypted URLs

  • Obtain metadata from image operations in thumbor

DEPENDENCIES

No dependencies required for regular usage.

USAGE:

crypto = CryptoURL.new :key => 'my-security-key'

url = crypto.generate :width => 200, :height => 300, :image => 'my.server.com/path/to/image.jpg'

# url will contain something like:
# /2913921in321n3k2nj32hjhj3h22/my.server.com/path/to/image.jpg

Available arguments to the generate method:

:meta => bool - flag that indicates that thumbor should return only meta-data on the operations it would
                otherwise perform;

:crop => [<int>, <int>, <int>, <int>] - Coordinates for manual cropping. The first item is the two arguments are
                                        the coordinates for the left, top point and the last two are the coordinates
                                        for the right, bottom point (thus forming the square to crop);

:width => <int> - the width for the thumbnail;

:height => <int> - the height for the thumbnail;

:flip => <bool> - flag that indicates that thumbor should flip horizontally (on the vertical axis) the image;

:flop => <bool> - flag that indicates that thumbor should flip vertically (on the horizontal axis) the image;

:halign => :left, :center or :right - horizontal alignment that thumbor should use for cropping;

:valign => :top, :middle or :bottom - horizontal alignment that thumbor should use for cropping;

:smart => <bool> - flag that indicates that thumbor should use smart cropping;

If you need more info on what each option does, check thumbor's documentation at github.com/globocom/thumbor/wiki.

INSTALL:

  • sudo gem install ruby-thumbor

CONTRIBUTIONS:

  • Hugo Lopes (hugobr) - Fixes in the usage readme part of the docs.

LICENSE:

(The MIT License)

Copyright © 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.

Something went wrong with that request. Please try again.