apache_image_resizer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/apache/image_resizer/util.rb +15 -2
- data/lib/apache/image_resizer/version.rb +1 -1
- metadata +5 -5
data/README
CHANGED
@@ -213,17 +213,22 @@ module Apache
|
|
213
213
|
} or return
|
214
214
|
|
215
215
|
resize, offset = directives.values_at(:resize, :offset)
|
216
|
+
link = !offset
|
216
217
|
|
217
218
|
if resize
|
219
|
+
c, r = img.columns, img.rows
|
220
|
+
|
218
221
|
w, h = resize
|
219
222
|
h ||= DEFAULT_HEIGHT
|
220
223
|
|
221
224
|
unless enlarge || offset
|
222
|
-
w = [w,
|
223
|
-
h = [h,
|
225
|
+
w = [w, c].min
|
226
|
+
h = [h, r].min
|
224
227
|
end
|
225
228
|
|
226
229
|
img.resize_to_fit!(w, h)
|
230
|
+
|
231
|
+
link &&= img.columns == c && img.rows == r
|
227
232
|
end
|
228
233
|
|
229
234
|
if offset
|
@@ -232,6 +237,14 @@ module Apache
|
|
232
237
|
|
233
238
|
mkdir_for(target)
|
234
239
|
|
240
|
+
if link
|
241
|
+
if system('ln', source, target)
|
242
|
+
return img
|
243
|
+
elsif block
|
244
|
+
block['Link error: %s' % $?.exitstatus]
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
235
248
|
do_magick('Write', target, block) { |value|
|
236
249
|
img.write(value) or raise Magick::ImageMagickError
|
237
250
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apache_image_resizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jens Wille
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rmagick
|
@@ -102,7 +102,7 @@ licenses: []
|
|
102
102
|
post_install_message:
|
103
103
|
rdoc_options:
|
104
104
|
- --title
|
105
|
-
- apache_image_resizer Application documentation (v0.0.
|
105
|
+
- apache_image_resizer Application documentation (v0.0.5)
|
106
106
|
- --line-numbers
|
107
107
|
- --main
|
108
108
|
- README
|