insano_image_resizer 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,20 @@ module InsanoImageResizer
33
33
  result[:w] = run("#{@vips_path} im_header_int Xsize '#{input_path}'").to_f
34
34
  result[:h] = run("#{@vips_path} im_header_int Ysize '#{input_path}'").to_f
35
35
  result[:bands] = run("#{@vips_path} im_header_int Bands '#{input_path}'").to_f
36
+
37
+ # find the EXIF values
38
+ orientation = 0
39
+ begin
40
+ orientation = EXIFR::JPEG.new(input_path).orientation.to_i
41
+ rescue
42
+ orientation = 0
43
+ end
44
+
45
+ if orientation == 6 || orientation == 8
46
+ nh = result[:w]
47
+ result[:w] = result[:h]
48
+ result[:h] = nh
49
+ end
36
50
  return result
37
51
  end
38
52
 
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.4.5
4
+ version: 0.4.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: