Sha256: d451942721cac8b632fef37a010d9ae26ae35b4c54cb51bb277b8fa423fa4ce0

Contents?: true

Size: 1.93 KB

Versions: 1

Compression:

Stored size: 1.93 KB

Contents

h1. Thumbs

Image server proxy that can resize images on the fly. Built in ruby as a Rack application.

h2. Usage

config.ru

bc.. require "rubygems"
require "bundler/setup"

require 'thumbs'

run Thumbs.new(
    :url_map         => "/:size/:original_url", # url pattern, :original_url is required
    :thumbs_folder   => "public/system/thumbs", # default: false - do not write on disk
    :cache           => true,                   # cache resized images - has no effect unless thumbs_folder exist
    :cache_original  => true,                   # cache original images - has no effect unless thumbs_folder exist
    :runtime         => true,                   # add X-Runtime header
    :cache_control => {
      :ttl           => 86400,                  # add Expires and Cache-Control header for 24h
      :last_modified => true                    # add Last-Modfied header
    },
    :etag            => true,                   # add ETag
    :logfile         => "log/thumbs.log"        # log file
    :server_name     => "Thumbs/0.0.3",         # Server header
    :image_not_found => "image_not_found.jpg"   # path to image_not_found
  )

h2. TODO

 * Tests!
 * Access control
 * use of Rack::Sendfile

h2. Contributing

 * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
 * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
 * Fork the project
 * Start a feature/bugfix branch
 * Commit and push until you are happy with your contribution
 * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
 * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

h2. Copyright

Copyright (c) 2011 Marcin Ciunelis. See LICENSE.txt for further details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thumbs-0.0.3 README.textile