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.
- data/lib/insano_image_resizer/processor.rb +14 -0
- metadata +1 -1
@@ -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
|
|