dragonfly_libvips 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 780dcfdbcda3d6e81588b91a2651d142480d4d69
4
- data.tar.gz: 4ca1ace6266c6403e82c1fb03e15f50a0ae54a02
3
+ metadata.gz: 835350b6d18b031b00f0071279b84694ef940e58
4
+ data.tar.gz: b306a0a01d08232767091e703772360526030795
5
5
  SHA512:
6
- metadata.gz: 76b520f7d255f5fc793c5fc3a31fd645cb1bc33e4a45f1950950401ea2601e46df6a9fba36395dce7696593ba55b8c856680e68451d78f190820ec2569f4cc51
7
- data.tar.gz: 65dde4e88198e4f517399fccedef3598c05bec4f01162a82eddd520d8877099b23914fd0b6de5142671fc528655751024387f8f728c13562d220a8cfe7a356be
6
+ metadata.gz: 4c54e214ddf782d3dbc3d09877de7f679c94c54df30ea510eb4b07bec5d02fcffa5481f34b987f79359f80a74c2de92b4abc09dc6c704fe71a3a2c38a54ddcde
7
+ data.tar.gz: a0955d32cfd0e2d0eee0e1ec66e1dafab85bed3f963d06b2572f6ee5a8f13d9347bf26d09badff09ec6d5918a34545a4caa2556b7e9f1c5881178c2e08bfe248
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.0.1
4
+
5
+ * `ruby-vips` updated to `>= 2.0.1`
6
+ * added `autorotate` support, based on `orientation` value from EXIF tags (JPEG only)
7
+
3
8
  ## 2.0.0
4
9
 
5
10
  * `ruby-vips` updated to `~> 2.0`
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'dragonfly', '~> 1.0'
22
- spec.add_dependency 'ruby-vips', '~> 2.0'
22
+ spec.add_dependency 'ruby-vips', '~> 2.0', '>= 2.0.1'
23
23
  spec.add_dependency 'activesupport', '>= 4.0'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.12'
@@ -3,14 +3,22 @@ module DragonflyLibvips
3
3
  class ImageProperties
4
4
  def call(content)
5
5
  require 'vips'
6
- img = ::Vips::Image.new_from_file(content.path, access: :sequential)
6
+
7
+ input_options = {}
8
+ input_options[:access] = :sequential
9
+ input_options[:autorotate] = true if content.mime_type == 'image/jpeg'
10
+
11
+ img = ::Vips::Image.new_from_file(content.path, input_options)
12
+
13
+ width, height = img.width, img.height
14
+ xres, yres = img.xres, img.yres
7
15
 
8
16
  {
9
17
  'format' => content.ext,
10
- 'width' => img.width,
11
- 'height' => img.height,
12
- 'xres' => img.xres,
13
- 'yres' => img.yres
18
+ 'width' => width,
19
+ 'height' => height,
20
+ 'xres' => xres,
21
+ 'yres' => yres
14
22
  }
15
23
  end
16
24
  end
@@ -10,6 +10,9 @@ module DragonflyLibvips
10
10
  output_options = options.fetch('output_options', {})
11
11
 
12
12
  input_options['access'] ||= 'sequential'
13
+ if content.mime_type == 'image/jpeg'
14
+ input_options['autorotate'] = true unless input_options.has_key?('autorotate')
15
+ end
13
16
  output_options['profile'] ||= DragonflyLibvips::EPROFILE_PATH
14
17
 
15
18
  require 'vips'
@@ -12,6 +12,9 @@ module DragonflyLibvips
12
12
  output_options = options.fetch('output_options', {})
13
13
 
14
14
  input_options['access'] ||= 'sequential'
15
+ if content.mime_type == 'image/jpeg'
16
+ input_options['autorotate'] = true unless input_options.has_key?('autorotate')
17
+ end
15
18
  output_options['profile'] ||= DragonflyLibvips::EPROFILE_PATH
16
19
 
17
20
  require 'vips'
@@ -1,5 +1,6 @@
1
1
  require 'active_support/core_ext/hash'
2
2
  require 'dragonfly_libvips/dimensions'
3
+ require 'vips'
3
4
 
4
5
  module DragonflyLibvips
5
6
  module Processors
@@ -18,13 +19,15 @@ module DragonflyLibvips
18
19
  output_options = options.fetch('output_options', {})
19
20
 
20
21
  input_options['access'] ||= 'sequential'
22
+ if content.mime_type == 'image/jpeg'
23
+ input_options['autorotate'] = true unless input_options.has_key?('autorotate')
24
+ end
21
25
  output_options['profile'] ||= DragonflyLibvips::EPROFILE_PATH
22
26
 
23
- require 'vips'
24
27
  img = ::Vips::Image.new_from_file(content.path, input_options)
25
28
 
26
29
  dimensions = case geometry
27
- when RESIZE_GEOMETRY then DragonflyLibvips::Dimensions.call(geometry, img.width, img.height)
30
+ when RESIZE_GEOMETRY then DragonflyLibvips::Dimensions.call(geometry, img.width, img.height)
28
31
  else raise ArgumentError, "Didn't recognise the geometry string #{geometry}"
29
32
  end
30
33
 
@@ -1,3 +1,3 @@
1
1
  module DragonflyLibvips
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly_libvips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-22 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dragonfly
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.0.1
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '2.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.0.1
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: activesupport
43
49
  requirement: !ruby/object:Gem::Requirement