insano_image_resizer 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,9 +25,9 @@ module InsanoImageResizer
25
25
  # There's actually some extra metadata we ignore here, but this seems to be
26
26
  # the only way to get width and height from VIPS.
27
27
  result = {}
28
- result[:w] = run("vips im_header_int Xsize '#{input_path}'").to_f
29
- result[:h] = run("vips im_header_int Ysize '#{input_path}'").to_f
30
- result[:bands] = run("vips im_header_int Bands '#{input_path}'").to_f
28
+ result[:w] = run("/usr/local/bin/vips im_header_int Xsize '#{input_path}'").to_f
29
+ result[:h] = run("/usr/local/bin/vips im_header_int Ysize '#{input_path}'").to_f
30
+ result[:bands] = run("/usr/local/bin/vips im_header_int Bands '#{input_path}'").to_f
31
31
  return result
32
32
  end
33
33
 
@@ -197,12 +197,12 @@ module InsanoImageResizer
197
197
  end
198
198
  intermediate_path = input_path[0..-4]+"_shrunk." + output_extension
199
199
 
200
- run("vips im_shrink '#{input_path}' '#{intermediate_path}#{quality_extension}' #{shrink_factor} #{shrink_factor}")
201
- run("vips im_affine '#{intermediate_path}' '#{output_path}#{quality_extension}' #{transform[:scale]} 0 0 #{transform[:scale]} 0 0 #{transform[:x]} #{transform[:y]} #{transform[:w]} #{transform[:h]}")
200
+ run("/usr/local/bin/vips im_shrink '#{input_path}' '#{intermediate_path}#{quality_extension}' #{shrink_factor} #{shrink_factor}")
201
+ run("/usr/local/bin/vips im_affine '#{intermediate_path}' '#{output_path}#{quality_extension}' #{transform[:scale]} 0 0 #{transform[:scale]} 0 0 #{transform[:x]} #{transform[:y]} #{transform[:w]} #{transform[:h]}")
202
202
  FileUtils.rm(intermediate_path)
203
203
 
204
204
  else
205
- run("vips im_affine '#{input_path}' '#{output_path}#{quality_extension}' #{transform[:scale]} 0 0 #{transform[:scale]} 0 0 #{transform[:x]} #{transform[:y]} #{transform[:w]} #{transform[:h]}")
205
+ run("/usr/local/bin/vips im_affine '#{input_path}' '#{output_path}#{quality_extension}' #{transform[:scale]} 0 0 #{transform[:scale]} 0 0 #{transform[:x]} #{transform[:y]} #{transform[:w]} #{transform[:h]}")
206
206
 
207
207
  end
208
208
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insano_image_resizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: