README.md in riiif-0.0.3 vs README.md in riiif-0.0.4
- old
+ new
@@ -1,6 +1,7 @@
# Riiif
+[![Gem Version](https://badge.fury.io/rb/riiif.png)](http://badge.fury.io/rb/riiif)
A Ruby IIIF image server as a rails engine
## Installation
@@ -29,20 +30,25 @@
```
/opt/repository/images/foo_image.{png,jpg,tiff,jp,jp2}
```
### Images retrieved over HTTP
-To source the images from the network instead of the file system, we first configure Riiif to use an alternative resolver:
+It's preferable to use files on the filesystem, because this avoids the overhead of downloading the file. If this is unavoidable, Riiif can be configured to fetch files from the network. To enable this behavior, configure Riiif to use an alternative resolver:
```
Riiif::Image.file_resolver = Riiif::HTTPFileResolver
```
Then we configure the resolver with a mechanism for mapping the provided id to a url:
```
Riiif::HTTPFileResolver.id_to_uri = lambda do |id|
"http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/#{id}.jpg/600px-#{id}.jpg"
end
```
+
+This file resolver caches the network files, so you will want to clear out the old files or the cache will expand until you run out of disk space.
+Using a script like this would be a good idea: https://github.com/pulibrary/loris/blob/607567b921404a15a2111fbd7123604f4fdec087/bin/loris-cache_clean.sh
+By default the cache is located in `tmp/network_files`. You can set the cache path like this: `Riiif::HTTPFileResolver.cache_path = '/var/cache'`
+
## Usage
Mount the gem as an engine:
```
mount Riiif::Engine => '/image-service'
@@ -55,8 +61,24 @@
* http://www.example.org/image-service/abcd1234/full/,100/0/native.jpg
* http://www.example.org/image-service/abcd1234/full/pct:50/0/native.jpg
* http://www.example.org/image-service/abcd1234/full/150,75/0/native.jpg
* http://www.example.org/image-service/abcd1234/full/!150,75/0/native.jpg
-For more information see the IIIF spec:
+### OpenSeadragon
+
+Riiif ships with OpenSeaDragon support. To use it add this in your controller:
+
+```ruby
+helper Riiif::OpenseadragonHelper
+```
+
+Then in your view you can do this:
+```erb
+ <%=javascript_include_tag "openseadragon.js" %>
+ <%= openseadragon_viewer(@image.id, html: {style: 'width: 800px; height: 600px;'}) %>
+```
+
+
+## For more information
+see the IIIF spec:
http://www-sul.stanford.edu/iiif/image-api/1.1/