dragonfly_libvips 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/dragonfly_libvips.rb +2 -2
- data/lib/dragonfly_libvips/analysers/image_properties.rb +2 -1
- data/lib/dragonfly_libvips/processors/encode.rb +3 -2
- data/lib/dragonfly_libvips/processors/extract_area.rb +2 -1
- data/lib/dragonfly_libvips/processors/rotate.rb +2 -1
- data/lib/dragonfly_libvips/processors/thumb.rb +2 -1
- data/lib/dragonfly_libvips/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22507c180108f12d1b3ea9f5f3eca6073399fd203b1b51737806474488b1ce96
|
4
|
+
data.tar.gz: c6e5f41766780ce99f72aff7ec8f8604720ba8c8eafdded36edc50e563eef22b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dd8eb79e9a61b8f909469ba53235c3921d508298c7313e6ec1db1e061b840ef9b1d9280c04dc6a4c4eeba4ea2cebe26194a9f6bf5520399fbd4a219057ac65d
|
7
|
+
data.tar.gz: cc7af38494afdd7fc9f20232a722cab5d99e6e196b018e7c17a4c10c5c575f02507f73f10bdcbce59df582f4b8da8d3143ee634c4de4e9227800ce9f8c26b3ef
|
data/CHANGELOG.md
CHANGED
data/lib/dragonfly_libvips.rb
CHANGED
@@ -13,12 +13,12 @@ module DragonflyLibvips
|
|
13
13
|
|
14
14
|
SUPPORTED_FORMATS = begin
|
15
15
|
output = `vips -l | grep -i ForeignLoad`
|
16
|
-
output.scan(/\.(\w{1,4})/).flatten.sort.uniq
|
16
|
+
output.scan(/\.(\w{1,4})/).flatten.compact.sort.map(&:downcase).uniq
|
17
17
|
end
|
18
18
|
|
19
19
|
SUPPORTED_OUTPUT_FORMATS = begin
|
20
20
|
output = `vips -l | grep -i ForeignSave`
|
21
|
-
output.scan(/\.(\w{1,4})/).flatten.sort.uniq
|
21
|
+
output.scan(/\.(\w{1,4})/).flatten.compact.sort.map(&:downcase).uniq
|
22
22
|
end - %w[
|
23
23
|
csv
|
24
24
|
mat
|
@@ -6,7 +6,8 @@ module DragonflyLibvips
|
|
6
6
|
DPI = 300
|
7
7
|
|
8
8
|
def call(content)
|
9
|
-
return {} unless
|
9
|
+
return {} unless content.ext
|
10
|
+
return {} unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
10
11
|
|
11
12
|
input_options = {}
|
12
13
|
input_options['access'] = 'sequential'
|
@@ -4,13 +4,14 @@ module DragonflyLibvips
|
|
4
4
|
FORMATS_WITHOUT_PROFILE_SUPPORT = %w[dz webp hdr]
|
5
5
|
|
6
6
|
def call(content, format, options = {})
|
7
|
-
raise UnsupportedFormat unless
|
7
|
+
raise UnsupportedFormat unless content.ext
|
8
|
+
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
8
9
|
|
9
10
|
format = format.to_s
|
10
11
|
format = 'tif' if format == 'tiff'
|
11
12
|
format = 'jpg' if format == 'jpeg'
|
12
13
|
|
13
|
-
raise UnsupportedOutputFormat unless SUPPORTED_OUTPUT_FORMATS.include?(format)
|
14
|
+
raise UnsupportedOutputFormat unless SUPPORTED_OUTPUT_FORMATS.include?(format.downcase)
|
14
15
|
|
15
16
|
if content.mime_type == Rack::Mime.mime_type(".#{format}")
|
16
17
|
content.ext ||= format
|
@@ -2,7 +2,8 @@ module DragonflyLibvips
|
|
2
2
|
module Processors
|
3
3
|
class ExtractArea
|
4
4
|
def call(content, x, y, width, height, options = {})
|
5
|
-
raise UnsupportedFormat unless
|
5
|
+
raise UnsupportedFormat unless content.ext
|
6
|
+
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
6
7
|
|
7
8
|
options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
|
8
9
|
format = options.fetch('format', content.ext)
|
@@ -2,7 +2,8 @@ module DragonflyLibvips
|
|
2
2
|
module Processors
|
3
3
|
class Rotate
|
4
4
|
def call(content, rotate, options = {})
|
5
|
-
raise UnsupportedFormat unless
|
5
|
+
raise UnsupportedFormat unless content.ext
|
6
|
+
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
6
7
|
|
7
8
|
options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
|
8
9
|
format = options.fetch('format', content.ext)
|
@@ -9,7 +9,8 @@ module DragonflyLibvips
|
|
9
9
|
DPI = 300
|
10
10
|
|
11
11
|
def call(content, geometry, options = {})
|
12
|
-
raise UnsupportedFormat unless
|
12
|
+
raise UnsupportedFormat unless content.ext
|
13
|
+
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
13
14
|
|
14
15
|
options = options.each_with_object({}) { |(k, v), memo| memo[k.to_s] = v } # stringify keys
|
15
16
|
|