Project

imagecache

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby Image Cropping and Caching Library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 11.3.0, ~> 11.3.0

Runtime

>= 4.0, ~> 4.0
>= 1.60.2, ~> 1.60.2
>= 3.0, ~> 3.0
 Project Readme

Imagecache

An image cropping and caching library written in Ruby

Build Status Build Status
Code Quality Code Climate Code Coverage
## Installation
gem install imagecache

Usage

In your routes file:

get 'imagecache/*permalink' => 'imagecache#show', :permalink => /imagecache\/.*/

In your controller:

class ImagecacheController < ApplicationController

  def show
    if image = Imagecache::Base.process(params[:permalink])
      redirect_to params[:permalink], status: 301
    else
      render text: '', status: 404
    end
  end

end

If you have the file image.jpg in your public/assets folder, then point your browser to http://example.com/imagecache/assets/ft250x250/image.jpg to get a cropped version of image.jpg that fits within a 250x250 pixel cropping.