riiif 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/app/models/riiif/image.rb +13 -6
- data/lib/riiif/engine.rb +3 -0
- data/lib/riiif/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5e8d0c868b034e0955aef6e76fe8e6b0944787a
|
4
|
+
data.tar.gz: 5e8e67c40d3804bd7d3852b10f1347493d110c5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0f9f42f5a19abc877adba948c55b6e02ff5b03452d128df252823f65ac6c179e24e16885c9699550b4a86d09d5ddbed5463fc9b74ccccede4ea34d8adb49749
|
7
|
+
data.tar.gz: bb323cfe3324c38f2ebaffc0eec65044fd60c6fdd1cee9a0a3835f900ebec960f60402d770479ac716c8fdbfe254e556a3a2953d3cce6b4d3b94a342eee44ee1
|
data/README.md
CHANGED
@@ -87,6 +87,9 @@ ImageMagick must be installed with jasper support
|
|
87
87
|
```bash
|
88
88
|
brew install imagemagick --with-jasper # if using Homebrew
|
89
89
|
```
|
90
|
+
It appears that as of imagemagick 6.8.8 you have to use openjpeg2 instead of jasper:
|
91
|
+
http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=25357#p109912
|
92
|
+
This doesn't appear to be possible on homebrew until this ticket gets closed: https://github.com/Homebrew/homebrew/issues/28153
|
90
93
|
|
91
94
|
Run the tests
|
92
95
|
```bash
|
data/app/models/riiif/image.rb
CHANGED
@@ -11,7 +11,7 @@ module Riiif
|
|
11
11
|
# example:
|
12
12
|
# {:height=>390, :width=>600}
|
13
13
|
self.info_service = lambda do |id, image|
|
14
|
-
Rails.cache.fetch(
|
14
|
+
Rails.cache.fetch(cache_key(id, { info: true }), compress: true, expires_in: expires_in) do
|
15
15
|
image.info
|
16
16
|
end
|
17
17
|
end
|
@@ -29,7 +29,7 @@ module Riiif
|
|
29
29
|
|
30
30
|
def render(args)
|
31
31
|
options = decode_options!(args)
|
32
|
-
Rails.cache.fetch(Image.cache_key(id, options), compress: true, expires_in:
|
32
|
+
Rails.cache.fetch(Image.cache_key(id, options), compress: true, expires_in: Image.expires_in) do
|
33
33
|
image.extract(options)
|
34
34
|
end
|
35
35
|
end
|
@@ -38,10 +38,17 @@ module Riiif
|
|
38
38
|
info_service.call(id, image)
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
class << self
|
42
|
+
def expires_in
|
43
|
+
Riiif::Engine.config.cache_duration_in_days.days
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def cache_key(id, options)
|
48
|
+
str = options.merge(id: id).delete_if {|_, v| v.nil?}.to_s
|
49
|
+
# Use a MD5 digest to ensure the keys aren't too long.
|
50
|
+
Digest::MD5.hexdigest(str)
|
51
|
+
end
|
45
52
|
end
|
46
53
|
|
47
54
|
private
|
data/lib/riiif/engine.rb
CHANGED
data/lib/riiif/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riiif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|