dragonfly_libvips 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4b64d88420b228e976b7c0d5792e803ea538862d8b6fa4ad6cd48351f88c7e6
4
- data.tar.gz: 827caa0406199bc7ae5911346a378762e3a293c1be3481a69461ea5b5109cd13
3
+ metadata.gz: 22507c180108f12d1b3ea9f5f3eca6073399fd203b1b51737806474488b1ce96
4
+ data.tar.gz: c6e5f41766780ce99f72aff7ec8f8604720ba8c8eafdded36edc50e563eef22b
5
5
  SHA512:
6
- metadata.gz: 714d74358f8d176013dc78b7c89fd25e328b3d94816ad0acc82c86ee84110884a4713f8312802de727b9ecc62498976a141751683bf2157e2b0ca27bc7d94367
7
- data.tar.gz: 6a2fe288e736019d108262b17fd0bcae88cfc4d7428508042309f0204adef8e157ed7b4dadde3c32aff42f9d99a8337d961e6a697ec280d9986d747aef73478d
6
+ metadata.gz: 4dd8eb79e9a61b8f909469ba53235c3921d508298c7313e6ec1db1e061b840ef9b1d9280c04dc6a4c4eeba4ea2cebe26194a9f6bf5520399fbd4a219057ac65d
7
+ data.tar.gz: cc7af38494afdd7fc9f20232a722cab5d99e6e196b018e7c17a4c10c5c575f02507f73f10bdcbce59df582f4b8da8d3143ee634c4de4e9227800ce9f8c26b3ef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.3.1
4
+
5
+ * improved `SUPPORTED_FORMATS` matching that ignores case
6
+
3
7
  ## 2.3.0
4
8
 
5
9
  * add support for progressive JPEGs
@@ -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 SUPPORTED_FORMATS.include?(content.ext)
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 SUPPORTED_FORMATS.include?(content.ext)
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 SUPPORTED_FORMATS.include?(content.ext)
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 SUPPORTED_FORMATS.include?(content.ext)
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 SUPPORTED_FORMATS.include?(content.ext)
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
 
@@ -1,3 +1,3 @@
1
1
  module DragonflyLibvips
2
- VERSION = '2.3.0'.freeze
2
+ VERSION = '2.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly_libvips
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna