Ruby library for slicing images for use by the zoomifier flash application
Go to file
Donald Ball 99fc9db75c fixing markdown 2008-11-24 23:18:54 -06:00
assets swfobject is the gold standard for embedding flash 2008-11-23 22:41:32 -06:00
bin fixing up gemspec 2008-11-21 15:33:34 -06:00
lib removed version from the source header 2008-11-24 23:15:26 -06:00
spec fixed path to zoomifyViewer.swf 2008-11-24 22:18:47 -06:00
.gitignore ignore .DS_STORE and vim swap files 2008-11-21 00:31:43 -06:00
LICENSE.txt adding flash player and its license terms 2008-11-21 15:43:23 -06:00
README.markdown fixing markdown 2008-11-24 23:18:54 -06:00
init.rb registering swfobject as a default javascript library 2008-11-24 13:38:24 -06:00
install.rb adding rails plugin installer 2008-11-24 15:39:13 -06:00
zoomifier.gemspec bumped the version 2008-11-24 23:15:55 -06:00

README.markdown

Zoomifier

Version: 1.3 (November 24, 2008)

Authors: Donald Ball

Copyright: Copyright (c) 2008, Donald Ball

License: Apache Public License, v2.0

Zoomifier is a ruby library for creating directories of tiled images suitable for viewing with the free Zoomify flash player:

http://www.zoomify.com/

as well as a rails plugin that provides a helper method to make adding zoomified images to your rails app very easy.

Installation

To install the plugin:

script/plugin install git://github.com/dball/zoomifier.git

If you want the standalone library for whatever reason:

sudo gem install dball-zoomifier

all this gets you is the zoomify script installed in your PATH, though, and the free convert released by Zoomify is quite a bit faster.

I'm working on a GemPlugin version, but I can't seem to figure out how you're supposed to have assets installed; there doesn't seem to be any command which runs the GemPlugin's install.rb script.

Testing

Install the rspec gem, if you don't already have it, then run spec spec from the vendor/plugins/zoomifier directory.

Usage

In your views, wherever you want a zoomified image:

<%= zoomify_image_tag ('image.jpg', { :id => 'foo', :width => 400, :height => 300 }) %>

This will render a zoomified image with the specified dimensions using the swfobject Javascript library. An image tag with given attributes, except for the id (which is used to tag the div wrapper), is generated as a fallback for users without Javascript, so feel free to feed it alt and title and all that other good stuff as you see fit.

The directory of zoomified tiles is create in the same directory as the image, using its name without its extension, e.g. image/ in this example. The images will be automatically created if they do not exist already, or if the image file is newer than its tiles. Bear in mind this process can be fairly slow for large images, and of course, there's no point in zoomifying small images, so be patient on your first request. If there's sufficient, or, hell, any interest, I could write up some rake tasks to do this ahead of time.