dragonfly_libvips 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -4
- data/CHANGELOG.md +4 -0
- data/dragonfly_libvips.gemspec +1 -0
- data/lib/dragonfly_libvips.rb +2 -0
- data/lib/dragonfly_libvips/processors/encode.rb +10 -7
- data/lib/dragonfly_libvips/processors/extract_area.rb +11 -4
- data/lib/dragonfly_libvips/processors/rotate.rb +11 -4
- data/lib/dragonfly_libvips/processors/thumb.rb +7 -1
- data/lib/dragonfly_libvips/version.rb +1 -1
- data/samples/sample_anim.gif +0 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b67fa92ee376b9403bfce1ba81ebb1481ce966f0b388497df415c40f377c1c8
|
4
|
+
data.tar.gz: 3bfda08f15466387a2ff219afc743c86c1bb2e14130dbfbd0f4a5977ace4bf43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 577724d26ca7bf044820bab3659bd0becaf53fa1e21d0a9a1173d94c5bd003a3d0be48d931656ef554abf4b38c157bbae432771b5c6e7cbe48022fcc5e5e750d
|
7
|
+
data.tar.gz: '01784f6e6e9c1c562d1144106ec9eac5709565d81ab7cfd61872af5464b4a61e34297a558ed9274e446b1e4c02280da6319d0b1c46416f5275be25f51fb35711'
|
data/.travis.yml
CHANGED
@@ -5,15 +5,19 @@ script: 'bundle exec rake'
|
|
5
5
|
sudo: required
|
6
6
|
dist: trusty
|
7
7
|
rvm:
|
8
|
-
- 2.
|
8
|
+
- 2.6.1
|
9
9
|
|
10
10
|
before_install:
|
11
11
|
- gem install bundler -v 1.12.5
|
12
12
|
- sudo apt-get update
|
13
|
-
- sudo apt-get install -y gobject-introspection libgirepository1.0-dev libglib2.0-dev libpoppler-glib-dev
|
14
|
-
- curl -OL https://
|
15
|
-
- tar
|
13
|
+
- sudo apt-get install -y gobject-introspection libgirepository1.0-dev libglib2.0-dev libpoppler-glib-dev libgif-dev
|
14
|
+
- curl -OL https://imagemagick.org/download/ImageMagick.tar.gz
|
15
|
+
- tar xvzf ImageMagick.tar.gz && cd ImageMagick-7.0.8-27 && ./configure --with-modules=yes && sudo make && sudo make install
|
16
|
+
- sudo ldconfig
|
17
|
+
- cd ./..
|
16
18
|
- export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/
|
19
|
+
- curl -OL https://github.com/libvips/libvips/releases/download/v8.7.4/vips-8.7.4.tar.gz
|
20
|
+
- tar xvf vips-8.7.4.tar.gz && cd vips-8.7.4 && ./configure $1 && sudo make && sudo make install
|
17
21
|
- sudo ldconfig
|
18
22
|
|
19
23
|
notifications:
|
data/CHANGELOG.md
CHANGED
data/dragonfly_libvips.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency 'ruby-vips', '~> 2.0', '>= 2.0.6'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.12'
|
25
|
+
spec.add_development_dependency 'rb-readline'
|
25
26
|
spec.add_development_dependency 'guard'
|
26
27
|
spec.add_development_dependency 'guard-minitest'
|
27
28
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
data/lib/dragonfly_libvips.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
+
require 'vips'
|
2
|
+
|
1
3
|
module DragonflyLibvips
|
2
4
|
module Processors
|
3
5
|
class Encode
|
4
|
-
FORMATS_WITHOUT_PROFILE_SUPPORT = %w[dz webp hdr]
|
5
|
-
|
6
6
|
def call(content, format, options = {})
|
7
7
|
raise UnsupportedFormat unless content.ext
|
8
8
|
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
@@ -22,17 +22,20 @@ module DragonflyLibvips
|
|
22
22
|
options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
|
23
23
|
|
24
24
|
input_options = options.fetch('input_options', {})
|
25
|
-
output_options = options.fetch('output_options', {})
|
26
|
-
|
27
25
|
input_options['access'] ||= 'sequential'
|
28
26
|
if content.mime_type == 'image/jpeg'
|
29
27
|
input_options['autorotate'] = true unless input_options.has_key?('autorotate')
|
30
28
|
end
|
31
29
|
|
32
|
-
output_options
|
33
|
-
|
30
|
+
output_options = options.fetch('output_options', {})
|
31
|
+
if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
|
32
|
+
output_options.delete('profile')
|
33
|
+
else
|
34
|
+
output_options['profile'] ||= input_options.fetch('profile', EPROFILE_PATH)
|
35
|
+
end
|
36
|
+
output_options.delete('Q') unless format.to_s =~ /jpg|jpeg/i
|
37
|
+
output_options['format'] ||= format.to_s if format.to_s =~ /gif|bmp/i
|
34
38
|
|
35
|
-
require 'vips'
|
36
39
|
img = ::Vips::Image.new_from_file(content.path, input_options)
|
37
40
|
|
38
41
|
content.update(
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'vips'
|
2
|
+
|
1
3
|
module DragonflyLibvips
|
2
4
|
module Processors
|
3
5
|
class ExtractArea
|
@@ -9,17 +11,22 @@ module DragonflyLibvips
|
|
9
11
|
format = options.fetch('format', content.ext)
|
10
12
|
|
11
13
|
input_options = options.fetch('input_options', {})
|
12
|
-
output_options = options.fetch('output_options', {})
|
13
14
|
|
14
15
|
# input_options['access'] ||= 'sequential'
|
15
16
|
if content.mime_type == 'image/jpeg'
|
16
17
|
input_options['autorotate'] = true unless input_options.has_key?('autorotate')
|
17
18
|
end
|
18
|
-
output_options['profile'] ||= EPROFILE_PATH
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
output_options = options.fetch('output_options', {})
|
21
|
+
if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
|
22
|
+
output_options.delete('profile')
|
23
|
+
else
|
24
|
+
output_options['profile'] ||= input_options.fetch('profile', EPROFILE_PATH)
|
25
|
+
end
|
26
|
+
output_options.delete('Q') unless format.to_s =~ /jpg|jpeg/i
|
27
|
+
output_options['format'] ||= format.to_s if format.to_s =~ /gif|bmp/i
|
22
28
|
|
29
|
+
img = ::Vips::Image.new_from_file(content.path, input_options)
|
23
30
|
img = img.extract_area(x, y, width, height)
|
24
31
|
|
25
32
|
content.update(
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'vips'
|
2
|
+
|
1
3
|
module DragonflyLibvips
|
2
4
|
module Processors
|
3
5
|
class Rotate
|
@@ -9,17 +11,22 @@ module DragonflyLibvips
|
|
9
11
|
format = options.fetch('format', content.ext)
|
10
12
|
|
11
13
|
input_options = options.fetch('input_options', {})
|
12
|
-
output_options = options.fetch('output_options', {})
|
13
14
|
|
14
15
|
# input_options['access'] ||= 'sequential'
|
15
16
|
if content.mime_type == 'image/jpeg'
|
16
17
|
input_options['autorotate'] = true unless input_options.has_key?('autorotate')
|
17
18
|
end
|
18
|
-
output_options['profile'] ||= EPROFILE_PATH
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
output_options = options.fetch('output_options', {})
|
21
|
+
if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
|
22
|
+
output_options.delete('profile')
|
23
|
+
else
|
24
|
+
output_options['profile'] ||= input_options.fetch('profile', EPROFILE_PATH)
|
25
|
+
end
|
26
|
+
output_options.delete('Q') unless format.to_s =~ /jpg|jpeg/i
|
27
|
+
output_options['format'] ||= format.to_s if format.to_s =~ /gif|bmp/i
|
22
28
|
|
29
|
+
img = ::Vips::Image.new_from_file(content.path, input_options)
|
23
30
|
img = img.rot("d#{rotate}")
|
24
31
|
|
25
32
|
content.update(
|
@@ -30,7 +30,13 @@ module DragonflyLibvips
|
|
30
30
|
end
|
31
31
|
|
32
32
|
output_options = options.fetch('output_options', {})
|
33
|
-
|
33
|
+
if FORMATS_WITHOUT_PROFILE_SUPPORT.include?(format)
|
34
|
+
output_options.delete('profile')
|
35
|
+
else
|
36
|
+
output_options['profile'] ||= input_options.fetch('profile', EPROFILE_PATH)
|
37
|
+
end
|
38
|
+
output_options.delete('Q') unless format.to_s =~ /jpg|jpeg/i
|
39
|
+
output_options['format'] ||= format.to_s if format.to_s =~ /gif|bmp/i
|
34
40
|
|
35
41
|
input_options = input_options.each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v } # symbolize
|
36
42
|
img = ::Vips::Image.new_from_file(filename, input_options)
|
Binary file
|
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.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dragonfly
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.12'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rb-readline
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
61
75
|
- !ruby/object:Gem::Dependency
|
62
76
|
name: guard
|
63
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,6 +176,7 @@ files:
|
|
162
176
|
- samples/sample.png
|
163
177
|
- samples/sample.svg
|
164
178
|
- samples/sample.tif
|
179
|
+
- samples/sample_anim.gif
|
165
180
|
- samples/sample_cmyk.jpg
|
166
181
|
- samples/white pixel.png
|
167
182
|
- vendor/cmyk.icm
|
@@ -185,8 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
200
|
- !ruby/object:Gem::Version
|
186
201
|
version: '0'
|
187
202
|
requirements: []
|
188
|
-
|
189
|
-
rubygems_version: 2.7.6
|
203
|
+
rubygems_version: 3.0.1
|
190
204
|
signing_key:
|
191
205
|
specification_version: 4
|
192
206
|
summary: Dragonfly analysers and processors for libvips image processing library.
|