httpthumbnailer 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/features/httpthumbnailer.feature +1 -1
- data/httpthumbnailer.gemspec +1 -1
- data/lib/httpthumbnailer/thumbnailer.rb +10 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
@@ -162,7 +162,7 @@ Feature: Generating set of thumbnails with single PUT request
|
|
162
162
|
And second part content type will be text/plain
|
163
163
|
And second part body will be CRLF endend lines like
|
164
164
|
"""
|
165
|
-
Error: Magick::ImageMagickError: cache resources exhausted
|
165
|
+
Error: Thumbnailer::ImageTooLargeError: Magick::ImageMagickError: cache resources exhausted
|
166
166
|
"""
|
167
167
|
Then third part will contain JPEG image of size 16x32
|
168
168
|
And third part mime type will be image/jpeg
|
data/httpthumbnailer.gemspec
CHANGED
@@ -99,12 +99,17 @@ class Thumbnailer
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def thumbnail(spec)
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
begin
|
103
|
+
ImageHandler.new do
|
104
|
+
process_image(@image, spec).render_on_background!((spec.options['background-color'] or 'white').sub(/^0x/, '#'))
|
105
|
+
end.use do |thumb|
|
106
|
+
thumb.to_blob do |inf|
|
107
|
+
inf.format = spec.format
|
108
|
+
end
|
107
109
|
end
|
110
|
+
rescue Magick::ImageMagickError => e
|
111
|
+
raise ImageTooLargeError, e if e.message =~ /cache resources exhausted/
|
112
|
+
raise
|
108
113
|
end
|
109
114
|
end
|
110
115
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpthumbnailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jakub Pastuszek
|