imgwire 0.3.0 → 0.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: 51b2aefb2be738f37e07af70399bd781d56bdeacc886b4fdd86335ac2c52539f
4
- data.tar.gz: e60ce39c3b7825ab9cbcb632073839c5343cd667b3dbd6c5f3f6c6b25b522b44
3
+ metadata.gz: df6fe59538abf5207310fee7e35a2bc69122f3e989c79bad3a674979553ddc62
4
+ data.tar.gz: ea52a41f725f7d9ddd339151eb1e350a815b39276caddb1db643ba8627da9a50
5
5
  SHA512:
6
- metadata.gz: 51e0d57435f845cf12f0b3b677e75ab32fae572d1c2ee5b347c35cee54f964bdae11d9a974dd1f210fa3b09cedc9057332afb77e2ee01cef62a0a60c6d11547d
7
- data.tar.gz: 18bc491397f7fd0f0433abd0e9d645327ebd5437fe8365ac80eaf699f9c741a6403dd28a11b1731c6b408889eb6a157f7da20d83f3810c8dce10c379530fc720
6
+ metadata.gz: fd1bfa952e82bf07d9f0c3dd517d17e6863e15a1a8107ab743c262f64a72f71a866599f2a7f79d5ff9e8c5c2ad7dcd217319732429b4e93f5c7ec0665a31d442
7
+ data.tar.gz: 813abc30206d27d06d109af62d0a82b6bd8068244d050a6bdfe8fbb1a4317e84012aa429c63c2d23fb8d6fecd8311469ebe2a34c92cda7229d87716fef9f3eae
@@ -13,6 +13,7 @@ module Imgwire
13
13
  'background_alpha' => %w[bga background_alpha],
14
14
  'blur' => %w[bl blur],
15
15
  'brightness' => %w[br brightness],
16
+ 'chroma_subsampling' => %w[chroma_subsampling],
16
17
  'color_profile' => %w[cp icc color_profile],
17
18
  'colorize' => %w[col colorize],
18
19
  'contrast' => %w[co contrast],
@@ -38,6 +39,7 @@ module Imgwire
38
39
  'normalize' => %w[norm normalise normalize],
39
40
  'padding' => %w[pd padding],
40
41
  'pixelate' => %w[pix pixelate],
42
+ 'progressive' => %w[progressive],
41
43
  'quality' => %w[q quality],
42
44
  'resizing_algorithm' => %w[ra resizing_algorithm],
43
45
  'resizing_type' => %w[resizing_type],
@@ -58,6 +60,7 @@ module Imgwire
58
60
  }.freeze
59
61
 
60
62
  COLOR_PROFILES = %w[srgb rgb16 cmyk keep preserve].freeze
63
+ CHROMA_SUBSAMPLING_VALUES = %w[4:2:0 4:4:4 auto].freeze
61
64
  FORMATS = %w[auto jpg jpeg png webp avif gif tiff].freeze
62
65
  FLIP_VALUES = %w[vertical horizontal both].freeze
63
66
  RESIZING_ALGORITHMS = %w[nearest cubic mitchell lanczos2 lanczos3].freeze
@@ -122,6 +125,8 @@ module Imgwire
122
125
  normalize_true_or_number(value, min: 0.3, max: 100)
123
126
  when 'brightness', 'lightness', 'saturation'
124
127
  normalize_number(value, min: 0.01, max: 10)
128
+ when 'chroma_subsampling'
129
+ normalize_enum(value, CHROMA_SUBSAMPLING_VALUES)
125
130
  when 'color_profile'
126
131
  normalize_enum(value, COLOR_PROFILES)
127
132
  when 'contrast'
@@ -162,8 +167,10 @@ module Imgwire
162
167
  normalize_padding(value)
163
168
  when 'pixelate'
164
169
  normalize_integer(value, min: 2, max: 256)
170
+ when 'progressive'
171
+ normalize_boolean_or_auto(value)
165
172
  when 'quality'
166
- normalize_integer(value, min: 1, max: 100)
173
+ normalize_quality(value)
167
174
  when 'resizing_algorithm'
168
175
  normalize_enum(value, RESIZING_ALGORITHMS)
169
176
  when 'resizing_type'
@@ -501,6 +508,12 @@ module Imgwire
501
508
  contiguous_segments([top, right, bottom, left], []) || compact_json
502
509
  end
503
510
 
511
+ def normalize_quality(value)
512
+ return 'auto' if normalize_string(value) == 'auto'
513
+
514
+ normalize_integer(value, min: 1, max: 100)
515
+ end
516
+
504
517
  def normalize_rotate(value)
505
518
  return normalize_json_string(value) if json_object_string?(value)
506
519
 
@@ -721,6 +734,15 @@ module Imgwire
721
734
  parse_boolean(value) == true ? 'true' : nil
722
735
  end
723
736
 
737
+ def normalize_boolean_or_auto(value)
738
+ return 'auto' if normalize_string(value) == 'auto'
739
+
740
+ boolean = parse_boolean(value)
741
+ return 'true' if boolean == true
742
+
743
+ 'false' if boolean == false
744
+ end
745
+
724
746
  def parse_boolean(value)
725
747
  return true if value == true
726
748
  return false if value == false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Imgwire
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imgwire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blackhawk Software, LLC
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-04-29 00:00:00.000000000 Z
11
+ date: 2026-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus