imagekitio 4.4.1 → 4.5.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: 80964ea6011ceaf258682ad6031fa1389e2272040735d229cfb0414e078c15a8
4
- data.tar.gz: b8aa0c8144d7dba39c27e1894885b316f30e6afdf0f70e38ba1c21acf4d1b92a
3
+ metadata.gz: 32807ab073fef3c26ce54f01bdf16147557cba827fc3223b729d91dae957137b
4
+ data.tar.gz: ccdc8d842533ec7e7b26cc629a4077edbb30bc90b44183e76cd3411014c3423a
5
5
  SHA512:
6
- metadata.gz: de08a38b18bd6d2725b641dfe04a7677cdbe3b62b6933dfc1cdef958d492701cf784bfc079b71c22cc2d56c9eee09dfc1c696dacfc55e3e76da9af662d9c48f6
7
- data.tar.gz: 39ea8775ba9bce807bbc38d63693cdd499ecbf2a8deea54c9a2ead34ab94818ba359eab29fd608fd57efca3c644d9bd2b277a3667ddbea17b531c4812b82a805
6
+ metadata.gz: 2a4407defcf9137665389e1acf12ea56ff97d70c84f1548703a2bd465c93e47073984e7ef8afb7f9e6415e294b25a5ef8f8e7b4dd052fb537fb71837b9a89ef7
7
+ data.tar.gz: bc559cdfb8ee4878a17a06e14d156ef8a2ad8542bb874d9abe0eb5870f34ed0e628c3c86386e9c4f671ee449386fa47727909bced3c02538e418302a32323be7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.5.1 (2026-05-17)
4
+
5
+ Full Changelog: [v4.5.0...v4.5.1](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.5.0...v4.5.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **client:** elide content type header on requests without body ([9ae7bf6](https://github.com/imagekit-developer/imagekit-ruby/commit/9ae7bf673a15fc01cf7e25b6c508dd20fa6a38f7))
10
+
11
+ ## 4.5.0 (2026-05-13)
12
+
13
+ Full Changelog: [v4.4.1...v4.5.0](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.4.1...v4.5.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** add no-enlarge crop modes and colorize transformation ([1b56303](https://github.com/imagekit-developer/imagekit-ruby/commit/1b56303ef5c67cb1a4b36d4a1c06b147f22c5987))
18
+ * support setting headers via env ([cd32783](https://github.com/imagekit-developer/imagekit-ruby/commit/cd32783efe49d795b8a5de49eb44039cda375d2e))
19
+ * **transformation:** add colorize transformation support in URL generation ([3454064](https://github.com/imagekit-developer/imagekit-ruby/commit/34540646f7ee8a1deabeea629f366d28bc71f734))
20
+
21
+
22
+ ### Chores
23
+
24
+ * **internal:** codegen related update ([7e0543d](https://github.com/imagekit-developer/imagekit-ruby/commit/7e0543d8714ff251de1a32f471dc7bd8bfa17dab))
25
+
3
26
  ## 4.4.1 (2026-04-24)
4
27
 
5
28
  Full Changelog: [v4.4.0...v4.4.1](https://github.com/imagekit-developer/imagekit-ruby/compare/v4.4.0...v4.4.1)
data/README.md CHANGED
@@ -46,7 +46,7 @@ To use this gem, install via Bundler by adding the following to your application
46
46
  <!-- x-release-please-start-version -->
47
47
 
48
48
  ```ruby
49
- gem "imagekitio", "~> 4.4.1"
49
+ gem "imagekitio", "~> 4.5.1"
50
50
  ```
51
51
 
52
52
  <!-- x-release-please-end -->
@@ -120,6 +120,19 @@ module Imagekitio
120
120
  raise ArgumentError.new("private_key is required, and can be set via environ: \"IMAGEKIT_PRIVATE_KEY\"")
121
121
  end
122
122
 
123
+ headers = {}
124
+ custom_headers_env = ENV["IMAGE_KIT_CUSTOM_HEADERS"]
125
+ unless custom_headers_env.nil?
126
+ parsed = {}
127
+ custom_headers_env.split("\n").each do |line|
128
+ colon = line.index(":")
129
+ unless colon.nil?
130
+ parsed[line[0...colon].strip] = line[(colon + 1)..].strip
131
+ end
132
+ end
133
+ headers = parsed.merge(headers)
134
+ end
135
+
123
136
  @private_key = private_key.to_s
124
137
  @password = password.to_s
125
138
  @webhook_secret = webhook_secret&.to_s
@@ -129,7 +142,8 @@ module Imagekitio
129
142
  timeout: timeout,
130
143
  max_retries: max_retries,
131
144
  initial_retry_delay: initial_retry_delay,
132
- max_retry_delay: max_retry_delay
145
+ max_retry_delay: max_retry_delay,
146
+ headers: headers
133
147
  )
134
148
 
135
149
  @custom_metadata_fields = Imagekitio::Resources::CustomMetadataFields.new(client: self)
@@ -84,6 +84,7 @@ module Imagekitio
84
84
  "gradient" => "e-gradient",
85
85
  "color_replace" => "cr",
86
86
  "colorReplace" => "cr",
87
+ "colorize" => "e-colorize",
87
88
  "distort" => "e-distort",
88
89
 
89
90
  # Other flags & finishing
@@ -306,6 +306,8 @@ module Imagekitio
306
306
  Imagekitio::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ headers.delete("content-type") if body.nil?
310
+
309
311
  url = Imagekitio::Internal::Util.join_parsed_uri(
310
312
  @base_url_components,
311
313
  {**req, path: path, query: query}
@@ -138,6 +138,18 @@ module Imagekitio
138
138
  # @return [String, nil]
139
139
  optional :border, String
140
140
 
141
+ # @!attribute colorize
142
+ # Applies a color tint to the image. Accepts color and intensity as optional
143
+ # parameters.
144
+ #
145
+ # - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray
146
+ # color.
147
+ # - `in-intensity` - Intensity of the color (0-100). Default is 35. See
148
+ # [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
149
+ #
150
+ # @return [String, nil]
151
+ optional :colorize, String
152
+
141
153
  # @!attribute color_profile
142
154
  # Indicates whether the output image should retain the original color profile. See
143
155
  # [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp).
@@ -498,7 +510,7 @@ module Imagekitio
498
510
  # @return [Float, nil]
499
511
  optional :zoom, Float
500
512
 
501
- # @!method initialize(ai_change_background: nil, ai_drop_shadow: nil, ai_edit: nil, ai_remove_background: nil, ai_remove_background_external: nil, ai_retouch: nil, ai_upscale: nil, ai_variation: nil, aspect_ratio: nil, audio_codec: nil, background: nil, blur: nil, border: nil, color_profile: nil, color_replace: nil, contrast_stretch: nil, crop: nil, crop_mode: nil, default_image: nil, distort: nil, dpr: nil, duration: nil, end_offset: nil, flip: nil, focus: nil, format_: nil, gradient: nil, grayscale: nil, height: nil, lossless: nil, metadata: nil, named: nil, opacity: nil, original: nil, overlay: nil, page: nil, progressive: nil, quality: nil, radius: nil, raw: nil, rotation: nil, shadow: nil, sharpen: nil, start_offset: nil, streaming_resolutions: nil, trim: nil, unsharp_mask: nil, video_codec: nil, width: nil, x: nil, x_center: nil, y_: nil, y_center: nil, zoom: nil)
513
+ # @!method initialize(ai_change_background: nil, ai_drop_shadow: nil, ai_edit: nil, ai_remove_background: nil, ai_remove_background_external: nil, ai_retouch: nil, ai_upscale: nil, ai_variation: nil, aspect_ratio: nil, audio_codec: nil, background: nil, blur: nil, border: nil, colorize: nil, color_profile: nil, color_replace: nil, contrast_stretch: nil, crop: nil, crop_mode: nil, default_image: nil, distort: nil, dpr: nil, duration: nil, end_offset: nil, flip: nil, focus: nil, format_: nil, gradient: nil, grayscale: nil, height: nil, lossless: nil, metadata: nil, named: nil, opacity: nil, original: nil, overlay: nil, page: nil, progressive: nil, quality: nil, radius: nil, raw: nil, rotation: nil, shadow: nil, sharpen: nil, start_offset: nil, streaming_resolutions: nil, trim: nil, unsharp_mask: nil, video_codec: nil, width: nil, x: nil, x_center: nil, y_: nil, y_center: nil, zoom: nil)
502
514
  # Some parameter documentations has been truncated, see
503
515
  # {Imagekitio::Models::Transformation} for more details.
504
516
  #
@@ -535,6 +547,8 @@ module Imagekitio
535
547
  #
536
548
  # @param border [String] Adds a border to the output media. Accepts a string in the format `<border-width
537
549
  #
550
+ # @param colorize [String] Applies a color tint to the image. Accepts color and intensity as optional param
551
+ #
538
552
  # @param color_profile [Boolean] Indicates whether the output image should retain the original color profile.
539
553
  #
540
554
  # @param color_replace [String] Replaces colors in the image. Supports three formats:
@@ -765,6 +779,7 @@ module Imagekitio
765
779
  AT_MAX_ENLARGE = :at_max_enlarge
766
780
  AT_LEAST = :at_least
767
781
  MAINTAIN_RATIO = :maintain_ratio
782
+ MAINTAIN_RATIO_NO_ENLARGE = :maintain_ratio_no_enlarge
768
783
 
769
784
  # @!method self.values
770
785
  # @return [Array<Symbol>]
@@ -780,6 +795,8 @@ module Imagekitio
780
795
  PAD_RESIZE = :pad_resize
781
796
  EXTRACT = :extract
782
797
  PAD_EXTRACT = :pad_extract
798
+ PAD_RESIZE_NO_ENLARGE = :pad_resize_no_enlarge
799
+ PAD_EXTRACT_NO_SHRINK = :pad_extract_no_shrink
783
800
 
784
801
  # @!method self.values
785
802
  # @return [Array<Symbol>]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Imagekitio
4
- VERSION = "4.4.1"
4
+ VERSION = "4.5.1"
5
5
  end
@@ -198,6 +198,19 @@ module Imagekitio
198
198
  sig { params(border: String).void }
199
199
  attr_writer :border
200
200
 
201
+ # Applies a color tint to the image. Accepts color and intensity as optional
202
+ # parameters.
203
+ #
204
+ # - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray
205
+ # color.
206
+ # - `in-intensity` - Intensity of the color (0-100). Default is 35. See
207
+ # [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
208
+ sig { returns(T.nilable(String)) }
209
+ attr_reader :colorize
210
+
211
+ sig { params(colorize: String).void }
212
+ attr_writer :colorize
213
+
201
214
  # Indicates whether the output image should retain the original color profile. See
202
215
  # [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp).
203
216
  sig { returns(T.nilable(T::Boolean)) }
@@ -664,6 +677,7 @@ module Imagekitio
664
677
  background: String,
665
678
  blur: Float,
666
679
  border: String,
680
+ colorize: String,
667
681
  color_profile: T::Boolean,
668
682
  color_replace: String,
669
683
  contrast_stretch:
@@ -785,6 +799,14 @@ module Imagekitio
785
799
  # expression like `ih_div_20_FF00FF`. See
786
800
  # [Border](https://imagekit.io/docs/effects-and-enhancements#border---b).
787
801
  border: nil,
802
+ # Applies a color tint to the image. Accepts color and intensity as optional
803
+ # parameters.
804
+ #
805
+ # - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray
806
+ # color.
807
+ # - `in-intensity` - Intensity of the color (0-100). Default is 35. See
808
+ # [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
809
+ colorize: nil,
788
810
  # Indicates whether the output image should retain the original color profile. See
789
811
  # [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp).
790
812
  color_profile: nil,
@@ -998,6 +1020,7 @@ module Imagekitio
998
1020
  background: String,
999
1021
  blur: Float,
1000
1022
  border: String,
1023
+ colorize: String,
1001
1024
  color_profile: T::Boolean,
1002
1025
  color_replace: String,
1003
1026
  contrast_stretch:
@@ -1285,6 +1308,11 @@ module Imagekitio
1285
1308
  T.let(:at_least, Imagekitio::Transformation::Crop::TaggedSymbol)
1286
1309
  MAINTAIN_RATIO =
1287
1310
  T.let(:maintain_ratio, Imagekitio::Transformation::Crop::TaggedSymbol)
1311
+ MAINTAIN_RATIO_NO_ENLARGE =
1312
+ T.let(
1313
+ :maintain_ratio_no_enlarge,
1314
+ Imagekitio::Transformation::Crop::TaggedSymbol
1315
+ )
1288
1316
 
1289
1317
  sig do
1290
1318
  override.returns(
@@ -1313,6 +1341,16 @@ module Imagekitio
1313
1341
  :pad_extract,
1314
1342
  Imagekitio::Transformation::CropMode::TaggedSymbol
1315
1343
  )
1344
+ PAD_RESIZE_NO_ENLARGE =
1345
+ T.let(
1346
+ :pad_resize_no_enlarge,
1347
+ Imagekitio::Transformation::CropMode::TaggedSymbol
1348
+ )
1349
+ PAD_EXTRACT_NO_SHRINK =
1350
+ T.let(
1351
+ :pad_extract_no_shrink,
1352
+ Imagekitio::Transformation::CropMode::TaggedSymbol
1353
+ )
1316
1354
 
1317
1355
  sig do
1318
1356
  override.returns(
@@ -15,6 +15,7 @@ module Imagekitio
15
15
  background: String,
16
16
  blur: Float,
17
17
  border: String,
18
+ colorize: String,
18
19
  color_profile: bool,
19
20
  color_replace: String,
20
21
  contrast_stretch: Imagekitio::Models::Transformation::contrast_stretch,
@@ -127,6 +128,10 @@ module Imagekitio
127
128
 
128
129
  def border=: (String) -> String
129
130
 
131
+ attr_reader colorize: String?
132
+
133
+ def colorize=: (String) -> String
134
+
130
135
  attr_reader color_profile: bool?
131
136
 
132
137
  def color_profile=: (bool) -> bool
@@ -355,6 +360,7 @@ module Imagekitio
355
360
  ?background: String,
356
361
  ?blur: Float,
357
362
  ?border: String,
363
+ ?colorize: String,
358
364
  ?color_profile: bool,
359
365
  ?color_replace: String,
360
366
  ?contrast_stretch: Imagekitio::Models::Transformation::contrast_stretch,
@@ -412,6 +418,7 @@ module Imagekitio
412
418
  background: String,
413
419
  blur: Float,
414
420
  border: String,
421
+ colorize: String,
415
422
  color_profile: bool,
416
423
  color_replace: String,
417
424
  contrast_stretch: Imagekitio::Models::Transformation::contrast_stretch,
@@ -544,7 +551,12 @@ module Imagekitio
544
551
  end
545
552
 
546
553
  type crop =
547
- :force | :at_max | :at_max_enlarge | :at_least | :maintain_ratio
554
+ :force
555
+ | :at_max
556
+ | :at_max_enlarge
557
+ | :at_least
558
+ | :maintain_ratio
559
+ | :maintain_ratio_no_enlarge
548
560
 
549
561
  module Crop
550
562
  extend Imagekitio::Internal::Type::Enum
@@ -554,11 +566,17 @@ module Imagekitio
554
566
  AT_MAX_ENLARGE: :at_max_enlarge
555
567
  AT_LEAST: :at_least
556
568
  MAINTAIN_RATIO: :maintain_ratio
569
+ MAINTAIN_RATIO_NO_ENLARGE: :maintain_ratio_no_enlarge
557
570
 
558
571
  def self?.values: -> ::Array[Imagekitio::Models::Transformation::crop]
559
572
  end
560
573
 
561
- type crop_mode = :pad_resize | :extract | :pad_extract
574
+ type crop_mode =
575
+ :pad_resize
576
+ | :extract
577
+ | :pad_extract
578
+ | :pad_resize_no_enlarge
579
+ | :pad_extract_no_shrink
562
580
 
563
581
  module CropMode
564
582
  extend Imagekitio::Internal::Type::Enum
@@ -566,6 +584,8 @@ module Imagekitio
566
584
  PAD_RESIZE: :pad_resize
567
585
  EXTRACT: :extract
568
586
  PAD_EXTRACT: :pad_extract
587
+ PAD_RESIZE_NO_ENLARGE: :pad_resize_no_enlarge
588
+ PAD_EXTRACT_NO_SHRINK: :pad_extract_no_shrink
569
589
 
570
590
  def self?.values: -> ::Array[Imagekitio::Models::Transformation::crop_mode]
571
591
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagekitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ImageKit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-26 00:00:00.000000000 Z
11
+ date: 2026-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi