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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to apache_image_resizer version 0.0.4
5
+ This documentation refers to apache_image_resizer version 0.0.5
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -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, img.columns].min
223
- h = [h, img.rows ].min
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
  }
@@ -6,7 +6,7 @@ module Apache
6
6
 
7
7
  MAJOR = 0
8
8
  MINOR = 0
9
- TINY = 4
9
+ TINY = 5
10
10
 
11
11
  class << self
12
12
 
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
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-17 00:00:00 Z
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.4)
105
+ - apache_image_resizer Application documentation (v0.0.5)
106
106
  - --line-numbers
107
107
  - --main
108
108
  - README