dynamic_image 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97e9d1fe6e9eca656b2f800ff782b1e74e9f86dd0cf75da272470a2b92ee77c3
4
- data.tar.gz: 66c3cc61cdb78a845b13fa43101ac0235b5b72df2d5397cdf6e29033632be4bd
3
+ metadata.gz: 1bb0c1784966da4c77d72cca16f3210a70bc3902061bae5984078756569a7a3c
4
+ data.tar.gz: 3748823e9aab5f7a95ac7cd55edfd4a985c4f3d0d372324a3e58ecbffba4fa45
5
5
  SHA512:
6
- metadata.gz: '04423593c2dcc2f6797e37cb4d8a732f189d617632099cd81c8a56f7b10d5fd3f6b2c110527cd7c44ec5f91208c2f73d1a865d89e779a839db1834f4f3f7340d'
7
- data.tar.gz: 734fc7820ddd5b55c95cfe7311a1f449892dfb81eae9fc264393ec4d36e08982e11df89dfc56b2ff3c32a48dcc738623ff6062a173d0d931b6b24932951aaf93
6
+ metadata.gz: aa45a369b349ecbe15aad01725f979cb64ee5fdabd6c78b9f27fc2754fd05e0bf8cc65b792e7b8866c990aeb0c4037f602345a37ba8cc6c4fa2e35849f05c6f1
7
+ data.tar.gz: 99b4fa3790acecf8981cae6ca524601ff69cb9751768245d6cb0255bec7d43d10e7d129089a15e2cb4243a7821577c2ded5e9a9192d14e0d25f8758013a5f4c6
@@ -77,7 +77,7 @@ module DynamicImage
77
77
  respond_to do |format|
78
78
  format.html do
79
79
  render(template: "dynamic_image/images/show",
80
- layout: false, locals: { options: options })
80
+ layout: false, locals: { options: })
81
81
  end
82
82
  format.any(:gif, :jpeg, :jpg, :png, :tiff, :webp) do
83
83
  process_and_send(@record, options)
@@ -91,9 +91,9 @@ module DynamicImage
91
91
  respond_to do |format|
92
92
  format.any(:gif, :jpeg, :jpg, :png, :tiff, :webp) do
93
93
  send_data(@record.data,
94
- filename: filename,
94
+ filename:,
95
95
  content_type: @record.content_type,
96
- disposition: disposition)
96
+ disposition:)
97
97
  end
98
98
  end
99
99
  end
@@ -26,16 +26,13 @@ module DynamicImage
26
26
  #
27
27
  # image = Image.find(params[:id])
28
28
  # dynamic_image_tag(image)
29
- # # => <img alt="My file" height="200" src="..." width="320" />
29
+ # # => <img height="200" src="..." width="320" />
30
30
  # dynamic_image_tag(image, size: "100x100", alt="Avatar")
31
31
  # # => <img alt="Avatar" height="62" src="..." width="100" />
32
32
  def dynamic_image_tag(record_or_array, options = {})
33
- record = extract_dynamic_image_record(record_or_array)
34
- options = { alt: filename_to_alt(record.filename) }.merge(options)
35
-
36
33
  size = fit_size!(record_or_array, options)
37
34
  url_options = options.extract!(*allowed_dynamic_image_url_options)
38
- html_options = { size: size }.merge(options)
35
+ html_options = { size: }.merge(options)
39
36
 
40
37
  image_tag(dynamic_image_path_with_size(record_or_array,
41
38
  size,
@@ -143,7 +140,7 @@ module DynamicImage
143
140
  routing_type: :url,
144
141
  action: nil,
145
142
  format: default_format_for_image(record),
146
- size: size
143
+ size:
147
144
  }.merge(options)
148
145
  options[:digest] =
149
146
  dynamic_image_digest(record, options[:action], options[:size])
@@ -179,7 +176,7 @@ module DynamicImage
179
176
 
180
177
  def image_sizing(record, size_opts, uncropped)
181
178
  ImageSizing
182
- .new(record, uncropped: uncropped)
179
+ .new(record, uncropped:)
183
180
  .fit(size_opts[:size], size_opts).floor.to_s
184
181
  end
185
182
  end
@@ -77,7 +77,7 @@ module DynamicImage
77
77
  private
78
78
 
79
79
  def apply(new_image)
80
- self.class.new(new_image, target_format: target_format)
80
+ self.class.new(new_image, target_format:)
81
81
  end
82
82
 
83
83
  def blank_image
@@ -8,6 +8,10 @@ module DynamicImage
8
8
  class CreateVariant < ActiveJob::Base
9
9
  queue_as :dis
10
10
 
11
+ discard_on Dis::Errors::NotFoundError
12
+
13
+ retry_on StandardError, attempts: 10, wait: :polynomially_longer
14
+
11
15
  def perform(record, options, size)
12
16
  size_v = Vector2d.parse(size)
13
17
  DynamicImage::ProcessedImage.new(record, options)
@@ -77,7 +77,7 @@ module DynamicImage
77
77
  end
78
78
 
79
79
  { width: image.get("width"),
80
- height: height,
80
+ height:,
81
81
  colorspace: image.get("interpretation") }
82
82
  end
83
83
  end
@@ -100,7 +100,7 @@ module DynamicImage
100
100
  # Includes a timestamp fingerprint in the URL param, so
101
101
  # that rendered images can be cached indefinitely.
102
102
  def to_param
103
- [id, updated_at.utc.to_formatted_s(cache_timestamp_format)].join("-")
103
+ [id, updated_at.utc.to_fs(cache_timestamp_format)].join("-")
104
104
  end
105
105
 
106
106
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamicImage
4
- VERSION = "3.0.2"
4
+ VERSION = "3.0.3"
5
5
  end
@@ -19,8 +19,8 @@ module DynamicImage
19
19
  "#{file_name.pluralize}_controller.rb"),
20
20
  after: "ApplicationController\n"
21
21
  ) do
22
- " include DynamicImage::Controller\n\n private\n\n" \
23
- " def model\n #{class_name}\n end\n"
22
+ " include DynamicImage::Controller\n\n private\n\n " \
23
+ "def model\n #{class_name}\n end\n"
24
24
  end
25
25
  end
26
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_image
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2024-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dis
@@ -78,62 +78,6 @@ dependencies:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: 2.2.1
81
- - !ruby/object:Gem::Dependency
82
- name: rails-controller-testing
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
- - !ruby/object:Gem::Dependency
96
- name: rspec-rails
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: '0'
109
- - !ruby/object:Gem::Dependency
110
- name: simplecov
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: 0.17.1
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: 0.17.1
123
- - !ruby/object:Gem::Dependency
124
- name: sqlite3
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- version: '0'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: '0'
137
81
  description: DynamicImage is a Rails plugin that simplifies image uploading and processing
138
82
  email:
139
83
  - inge@elektronaut.no
@@ -186,14 +130,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
130
  requirements:
187
131
  - - ">="
188
132
  - !ruby/object:Gem::Version
189
- version: 2.7.0
133
+ version: 3.1.0
190
134
  required_rubygems_version: !ruby/object:Gem::Requirement
191
135
  requirements:
192
136
  - - ">="
193
137
  - !ruby/object:Gem::Version
194
138
  version: '0'
195
139
  requirements: []
196
- rubygems_version: 3.2.32
140
+ rubygems_version: 3.5.3
197
141
  signing_key:
198
142
  specification_version: 4
199
143
  summary: Rails plugin that simplifies image uploading and processing