activestorage 7.0.2.3 → 7.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activestorage might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -1
- data/app/controllers/active_storage/base_controller.rb +1 -1
- data/app/controllers/active_storage/blobs/proxy_controller.rb +1 -0
- data/app/controllers/active_storage/representations/proxy_controller.rb +2 -0
- data/app/controllers/concerns/active_storage/streaming.rb +1 -0
- data/app/models/active_storage/variant_with_record.rb +1 -1
- data/db/update_migrate/20190112182829_add_service_name_to_active_storage_blobs.rb +4 -0
- data/db/update_migrate/20191206030411_create_active_storage_variant_records.rb +2 -0
- data/db/update_migrate/20211119233751_remove_not_null_on_active_storage_blobs_checksum.rb +2 -0
- data/lib/active_storage/analyzer/image_analyzer/image_magick.rb +9 -7
- data/lib/active_storage/analyzer/image_analyzer/vips.rb +9 -7
- data/lib/active_storage/engine.rb +14 -16
- data/lib/active_storage/gem_version.rb +3 -3
- data/lib/active_storage/transformers/image_processing_transformer.rb +7 -294
- data/lib/active_storage/version.rb +1 -1
- data/lib/active_storage.rb +289 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30d8fadbd6953b6f7df95ba3dd293c0f720d5be32938a81c1395f460f43265d7
|
4
|
+
data.tar.gz: 432a78ced992c5717986d2a9bdb08ca21216a73e18246dfd86ce22b3c1c250cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de7317b086cf3d36aaf9a256ebac4cb7ebeb49e5087edbe665c49c17bc28544878d3bb4edc7cff271a4428ca4a57ea7ec66ca454e08aabebed137709c2e0a7ae
|
7
|
+
data.tar.gz: 0c8c8623a5c4e071938ae50add7e199274dc874964d1cf64f8ffff1f863f905392e54bb1dca24d0e1cd44f87c099d367080b144da265094bad861c58bb9b709b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
## Rails 7.0.4 (September 09, 2022) ##
|
2
|
+
|
3
|
+
* Fixes proxy downloads of files over 5MiB
|
4
|
+
|
5
|
+
Previously, trying to view and/or download files larger than 5mb stored in
|
6
|
+
services like S3 via proxy mode could return corrupted files at around
|
7
|
+
5.2mb or cause random halts in the download. Now,
|
8
|
+
`ActiveStorage::Blobs::ProxyController` correctly handles streaming these
|
9
|
+
larger files from the service to the client without any issues.
|
10
|
+
|
11
|
+
Fixes #44679
|
12
|
+
|
13
|
+
*Felipe Raul*
|
14
|
+
|
15
|
+
## Rails 7.0.3.1 (July 12, 2022) ##
|
16
|
+
|
17
|
+
* No changes.
|
18
|
+
|
19
|
+
|
20
|
+
## Rails 7.0.3 (May 09, 2022) ##
|
21
|
+
|
22
|
+
* Don't stream responses in redirect mode
|
23
|
+
|
24
|
+
Previously, both redirect mode and proxy mode streamed their
|
25
|
+
responses which caused a new thread to be created, and could end
|
26
|
+
up leaking connections in the connection pool. But since redirect
|
27
|
+
mode doesn't actually send any data, it doesn't need to be
|
28
|
+
streamed.
|
29
|
+
|
30
|
+
*Luke Lau*
|
31
|
+
|
32
|
+
## Rails 7.0.2.4 (April 26, 2022) ##
|
33
|
+
|
34
|
+
* No changes.
|
35
|
+
|
36
|
+
|
1
37
|
## Rails 7.0.2.3 (March 08, 2022) ##
|
2
38
|
|
3
39
|
* Added image transformation validation via configurable allow-list.
|
@@ -12,7 +48,6 @@
|
|
12
48
|
|
13
49
|
* No changes.
|
14
50
|
|
15
|
-
|
16
51
|
## Rails 7.0.2.1 (February 11, 2022) ##
|
17
52
|
|
18
53
|
* No changes.
|
@@ -8,6 +8,7 @@
|
|
8
8
|
# {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
|
9
9
|
class ActiveStorage::Blobs::ProxyController < ActiveStorage::BaseController
|
10
10
|
include ActiveStorage::SetBlob
|
11
|
+
include ActiveStorage::Streaming
|
11
12
|
|
12
13
|
def show
|
13
14
|
if request.headers["Range"].present?
|
@@ -7,6 +7,8 @@
|
|
7
7
|
# require a higher level of protection consider implementing
|
8
8
|
# {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
|
9
9
|
class ActiveStorage::Representations::ProxyController < ActiveStorage::Representations::BaseController
|
10
|
+
include ActiveStorage::Streaming
|
11
|
+
|
10
12
|
def show
|
11
13
|
http_cache_forever public: true do
|
12
14
|
send_blob_stream @representation.image, disposition: params[:disposition]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Like an ActiveStorage::Variant, but keeps detail about the variant in the database as an
|
4
|
-
# ActiveStorage::VariantRecord. This is only used if
|
4
|
+
# ActiveStorage::VariantRecord. This is only used if +ActiveStorage.track_variants+ is enabled.
|
5
5
|
class ActiveStorage::VariantWithRecord
|
6
6
|
attr_reader :blob, :variation
|
7
7
|
delegate :service, to: :blob
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
2
2
|
def up
|
3
|
+
return unless table_exists?(:active_storage_blobs)
|
4
|
+
|
3
5
|
unless column_exists?(:active_storage_blobs, :service_name)
|
4
6
|
add_column :active_storage_blobs, :service_name, :string
|
5
7
|
|
@@ -12,6 +14,8 @@ class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def down
|
17
|
+
return unless table_exists?(:active_storage_blobs)
|
18
|
+
|
15
19
|
remove_column :active_storage_blobs, :service_name
|
16
20
|
end
|
17
21
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
|
+
return unless table_exists?(:active_storage_blobs)
|
4
|
+
|
3
5
|
# Use Active Record's configured type for primary key
|
4
6
|
create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
|
5
7
|
t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
|
@@ -10,9 +10,14 @@ module ActiveStorage
|
|
10
10
|
|
11
11
|
private
|
12
12
|
def read_image
|
13
|
-
|
13
|
+
begin
|
14
14
|
require "mini_magick"
|
15
|
+
rescue LoadError
|
16
|
+
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
|
17
|
+
return {}
|
18
|
+
end
|
15
19
|
|
20
|
+
download_blob_to_tempfile do |file|
|
16
21
|
image = instrument("mini_magick") do
|
17
22
|
MiniMagick::Image.new(file.path)
|
18
23
|
end
|
@@ -23,13 +28,10 @@ module ActiveStorage
|
|
23
28
|
logger.info "Skipping image analysis because ImageMagick doesn't support the file"
|
24
29
|
{}
|
25
30
|
end
|
31
|
+
rescue MiniMagick::Error => error
|
32
|
+
logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
|
33
|
+
{}
|
26
34
|
end
|
27
|
-
rescue LoadError
|
28
|
-
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
|
29
|
-
{}
|
30
|
-
rescue MiniMagick::Error => error
|
31
|
-
logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
|
32
|
-
{}
|
33
35
|
end
|
34
36
|
|
35
37
|
def rotated_image?(image)
|
@@ -10,9 +10,14 @@ module ActiveStorage
|
|
10
10
|
|
11
11
|
private
|
12
12
|
def read_image
|
13
|
-
|
13
|
+
begin
|
14
14
|
require "ruby-vips"
|
15
|
+
rescue LoadError
|
16
|
+
logger.info "Skipping image analysis because the ruby-vips gem isn't installed"
|
17
|
+
return {}
|
18
|
+
end
|
15
19
|
|
20
|
+
download_blob_to_tempfile do |file|
|
16
21
|
image = instrument("vips") do
|
17
22
|
::Vips::Image.new_from_file(file.path, access: :sequential)
|
18
23
|
end
|
@@ -23,13 +28,10 @@ module ActiveStorage
|
|
23
28
|
logger.info "Skipping image analysis because Vips doesn't support the file"
|
24
29
|
{}
|
25
30
|
end
|
31
|
+
rescue ::Vips::Error => error
|
32
|
+
logger.error "Skipping image analysis due to an Vips error: #{error.message}"
|
33
|
+
{}
|
26
34
|
end
|
27
|
-
rescue LoadError
|
28
|
-
logger.info "Skipping image analysis because the ruby-vips gem isn't installed"
|
29
|
-
{}
|
30
|
-
rescue ::Vips::Error => error
|
31
|
-
logger.error "Skipping image analysis due to an Vips error: #{error.message}"
|
32
|
-
{}
|
33
35
|
end
|
34
36
|
|
35
37
|
ROTATIONS = /Right-top|Left-bottom|Top-right|Bottom-left/
|
@@ -80,20 +80,6 @@ module ActiveStorage
|
|
80
80
|
application/pdf
|
81
81
|
)
|
82
82
|
|
83
|
-
default_unsupported_image_processing_arguments = %w(
|
84
|
-
-debug
|
85
|
-
-display
|
86
|
-
-distribute-cache
|
87
|
-
-help
|
88
|
-
-path
|
89
|
-
-print
|
90
|
-
-set
|
91
|
-
-verbose
|
92
|
-
-version
|
93
|
-
-write
|
94
|
-
-write-mask
|
95
|
-
)
|
96
|
-
|
97
83
|
config.eager_load_namespaces << ActiveStorage
|
98
84
|
|
99
85
|
initializer "active_storage.configs" do
|
@@ -107,8 +93,20 @@ module ActiveStorage
|
|
107
93
|
ActiveStorage.draw_routes = app.config.active_storage.draw_routes != false
|
108
94
|
ActiveStorage.resolve_model_to_route = app.config.active_storage.resolve_model_to_route || :rails_storage_redirect
|
109
95
|
|
110
|
-
ActiveStorage.supported_image_processing_methods
|
111
|
-
ActiveStorage.unsupported_image_processing_arguments = app.config.active_storage.unsupported_image_processing_arguments ||
|
96
|
+
ActiveStorage.supported_image_processing_methods += app.config.active_storage.supported_image_processing_methods || []
|
97
|
+
ActiveStorage.unsupported_image_processing_arguments = app.config.active_storage.unsupported_image_processing_arguments || %w(
|
98
|
+
-debug
|
99
|
+
-display
|
100
|
+
-distribute-cache
|
101
|
+
-help
|
102
|
+
-path
|
103
|
+
-print
|
104
|
+
-set
|
105
|
+
-verbose
|
106
|
+
-version
|
107
|
+
-write
|
108
|
+
-write-mask
|
109
|
+
)
|
112
110
|
|
113
111
|
ActiveStorage.variable_content_types = app.config.active_storage.variable_content_types || []
|
114
112
|
ActiveStorage.web_image_content_types = app.config.active_storage.web_image_content_types || []
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ActiveStorage
|
4
|
-
# Returns the version of
|
4
|
+
# Returns the currently loaded version of Active Storage as a <tt>Gem::Version</tt>.
|
5
5
|
def self.gem_version
|
6
6
|
Gem::Version.new VERSION::STRING
|
7
7
|
end
|
@@ -9,8 +9,8 @@ module ActiveStorage
|
|
9
9
|
module VERSION
|
10
10
|
MAJOR = 7
|
11
11
|
MINOR = 0
|
12
|
-
TINY =
|
13
|
-
PRE =
|
12
|
+
TINY = 4
|
13
|
+
PRE = nil
|
14
14
|
|
15
15
|
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
16
16
|
end
|
@@ -15,297 +15,6 @@ module ActiveStorage
|
|
15
15
|
private
|
16
16
|
class UnsupportedImageProcessingMethod < StandardError; end
|
17
17
|
class UnsupportedImageProcessingArgument < StandardError; end
|
18
|
-
SUPPORTED_IMAGE_PROCESSING_METHODS = [
|
19
|
-
"adaptive_blur",
|
20
|
-
"adaptive_resize",
|
21
|
-
"adaptive_sharpen",
|
22
|
-
"adjoin",
|
23
|
-
"affine",
|
24
|
-
"alpha",
|
25
|
-
"annotate",
|
26
|
-
"antialias",
|
27
|
-
"append",
|
28
|
-
"apply",
|
29
|
-
"attenuate",
|
30
|
-
"authenticate",
|
31
|
-
"auto_gamma",
|
32
|
-
"auto_level",
|
33
|
-
"auto_orient",
|
34
|
-
"auto_threshold",
|
35
|
-
"backdrop",
|
36
|
-
"background",
|
37
|
-
"bench",
|
38
|
-
"bias",
|
39
|
-
"bilateral_blur",
|
40
|
-
"black_point_compensation",
|
41
|
-
"black_threshold",
|
42
|
-
"blend",
|
43
|
-
"blue_primary",
|
44
|
-
"blue_shift",
|
45
|
-
"blur",
|
46
|
-
"border",
|
47
|
-
"bordercolor",
|
48
|
-
"borderwidth",
|
49
|
-
"brightness_contrast",
|
50
|
-
"cache",
|
51
|
-
"canny",
|
52
|
-
"caption",
|
53
|
-
"channel",
|
54
|
-
"channel_fx",
|
55
|
-
"charcoal",
|
56
|
-
"chop",
|
57
|
-
"clahe",
|
58
|
-
"clamp",
|
59
|
-
"clip",
|
60
|
-
"clip_path",
|
61
|
-
"clone",
|
62
|
-
"clut",
|
63
|
-
"coalesce",
|
64
|
-
"colorize",
|
65
|
-
"colormap",
|
66
|
-
"color_matrix",
|
67
|
-
"colors",
|
68
|
-
"colorspace",
|
69
|
-
"colourspace",
|
70
|
-
"color_threshold",
|
71
|
-
"combine",
|
72
|
-
"combine_options",
|
73
|
-
"comment",
|
74
|
-
"compare",
|
75
|
-
"complex",
|
76
|
-
"compose",
|
77
|
-
"composite",
|
78
|
-
"compress",
|
79
|
-
"connected_components",
|
80
|
-
"contrast",
|
81
|
-
"contrast_stretch",
|
82
|
-
"convert",
|
83
|
-
"convolve",
|
84
|
-
"copy",
|
85
|
-
"crop",
|
86
|
-
"cycle",
|
87
|
-
"deconstruct",
|
88
|
-
"define",
|
89
|
-
"delay",
|
90
|
-
"delete",
|
91
|
-
"density",
|
92
|
-
"depth",
|
93
|
-
"descend",
|
94
|
-
"deskew",
|
95
|
-
"despeckle",
|
96
|
-
"direction",
|
97
|
-
"displace",
|
98
|
-
"dispose",
|
99
|
-
"dissimilarity_threshold",
|
100
|
-
"dissolve",
|
101
|
-
"distort",
|
102
|
-
"dither",
|
103
|
-
"draw",
|
104
|
-
"duplicate",
|
105
|
-
"edge",
|
106
|
-
"emboss",
|
107
|
-
"encoding",
|
108
|
-
"endian",
|
109
|
-
"enhance",
|
110
|
-
"equalize",
|
111
|
-
"evaluate",
|
112
|
-
"evaluate_sequence",
|
113
|
-
"extent",
|
114
|
-
"extract",
|
115
|
-
"family",
|
116
|
-
"features",
|
117
|
-
"fft",
|
118
|
-
"fill",
|
119
|
-
"filter",
|
120
|
-
"flatten",
|
121
|
-
"flip",
|
122
|
-
"floodfill",
|
123
|
-
"flop",
|
124
|
-
"font",
|
125
|
-
"foreground",
|
126
|
-
"format",
|
127
|
-
"frame",
|
128
|
-
"function",
|
129
|
-
"fuzz",
|
130
|
-
"fx",
|
131
|
-
"gamma",
|
132
|
-
"gaussian_blur",
|
133
|
-
"geometry",
|
134
|
-
"gravity",
|
135
|
-
"grayscale",
|
136
|
-
"green_primary",
|
137
|
-
"hald_clut",
|
138
|
-
"highlight_color",
|
139
|
-
"hough_lines",
|
140
|
-
"iconGeometry",
|
141
|
-
"iconic",
|
142
|
-
"identify",
|
143
|
-
"ift",
|
144
|
-
"illuminant",
|
145
|
-
"immutable",
|
146
|
-
"implode",
|
147
|
-
"insert",
|
148
|
-
"intensity",
|
149
|
-
"intent",
|
150
|
-
"interlace",
|
151
|
-
"interline_spacing",
|
152
|
-
"interpolate",
|
153
|
-
"interpolative_resize",
|
154
|
-
"interword_spacing",
|
155
|
-
"kerning",
|
156
|
-
"kmeans",
|
157
|
-
"kuwahara",
|
158
|
-
"label",
|
159
|
-
"lat",
|
160
|
-
"layers",
|
161
|
-
"level",
|
162
|
-
"level_colors",
|
163
|
-
"limit",
|
164
|
-
"limits",
|
165
|
-
"linear_stretch",
|
166
|
-
"linewidth",
|
167
|
-
"liquid_rescale",
|
168
|
-
"list",
|
169
|
-
"loader",
|
170
|
-
"log",
|
171
|
-
"loop",
|
172
|
-
"lowlight_color",
|
173
|
-
"magnify",
|
174
|
-
"map",
|
175
|
-
"mattecolor",
|
176
|
-
"median",
|
177
|
-
"mean_shift",
|
178
|
-
"metric",
|
179
|
-
"mode",
|
180
|
-
"modulate",
|
181
|
-
"moments",
|
182
|
-
"monitor",
|
183
|
-
"monochrome",
|
184
|
-
"morph",
|
185
|
-
"morphology",
|
186
|
-
"mosaic",
|
187
|
-
"motion_blur",
|
188
|
-
"name",
|
189
|
-
"negate",
|
190
|
-
"noise",
|
191
|
-
"normalize",
|
192
|
-
"opaque",
|
193
|
-
"ordered_dither",
|
194
|
-
"orient",
|
195
|
-
"page",
|
196
|
-
"paint",
|
197
|
-
"pause",
|
198
|
-
"perceptible",
|
199
|
-
"ping",
|
200
|
-
"pointsize",
|
201
|
-
"polaroid",
|
202
|
-
"poly",
|
203
|
-
"posterize",
|
204
|
-
"precision",
|
205
|
-
"preview",
|
206
|
-
"process",
|
207
|
-
"quality",
|
208
|
-
"quantize",
|
209
|
-
"quiet",
|
210
|
-
"radial_blur",
|
211
|
-
"raise",
|
212
|
-
"random_threshold",
|
213
|
-
"range_threshold",
|
214
|
-
"red_primary",
|
215
|
-
"regard_warnings",
|
216
|
-
"region",
|
217
|
-
"remote",
|
218
|
-
"render",
|
219
|
-
"repage",
|
220
|
-
"resample",
|
221
|
-
"resize",
|
222
|
-
"resize_to_fill",
|
223
|
-
"resize_to_fit",
|
224
|
-
"resize_to_limit",
|
225
|
-
"resize_and_pad",
|
226
|
-
"respect_parentheses",
|
227
|
-
"reverse",
|
228
|
-
"roll",
|
229
|
-
"rotate",
|
230
|
-
"sample",
|
231
|
-
"sampling_factor",
|
232
|
-
"saver",
|
233
|
-
"scale",
|
234
|
-
"scene",
|
235
|
-
"screen",
|
236
|
-
"seed",
|
237
|
-
"segment",
|
238
|
-
"selective_blur",
|
239
|
-
"separate",
|
240
|
-
"sepia_tone",
|
241
|
-
"shade",
|
242
|
-
"shadow",
|
243
|
-
"shared_memory",
|
244
|
-
"sharpen",
|
245
|
-
"shave",
|
246
|
-
"shear",
|
247
|
-
"sigmoidal_contrast",
|
248
|
-
"silent",
|
249
|
-
"similarity_threshold",
|
250
|
-
"size",
|
251
|
-
"sketch",
|
252
|
-
"smush",
|
253
|
-
"snaps",
|
254
|
-
"solarize",
|
255
|
-
"sort_pixels",
|
256
|
-
"sparse_color",
|
257
|
-
"splice",
|
258
|
-
"spread",
|
259
|
-
"statistic",
|
260
|
-
"stegano",
|
261
|
-
"stereo",
|
262
|
-
"storage_type",
|
263
|
-
"stretch",
|
264
|
-
"strip",
|
265
|
-
"stroke",
|
266
|
-
"strokewidth",
|
267
|
-
"style",
|
268
|
-
"subimage_search",
|
269
|
-
"swap",
|
270
|
-
"swirl",
|
271
|
-
"synchronize",
|
272
|
-
"taint",
|
273
|
-
"text_font",
|
274
|
-
"threshold",
|
275
|
-
"thumbnail",
|
276
|
-
"tile_offset",
|
277
|
-
"tint",
|
278
|
-
"title",
|
279
|
-
"transform",
|
280
|
-
"transparent",
|
281
|
-
"transparent_color",
|
282
|
-
"transpose",
|
283
|
-
"transverse",
|
284
|
-
"treedepth",
|
285
|
-
"trim",
|
286
|
-
"type",
|
287
|
-
"undercolor",
|
288
|
-
"unique_colors",
|
289
|
-
"units",
|
290
|
-
"unsharp",
|
291
|
-
"update",
|
292
|
-
"valid_image",
|
293
|
-
"view",
|
294
|
-
"vignette",
|
295
|
-
"virtual_pixel",
|
296
|
-
"visual",
|
297
|
-
"watermark",
|
298
|
-
"wave",
|
299
|
-
"wavelet_denoise",
|
300
|
-
"weight",
|
301
|
-
"white_balance",
|
302
|
-
"white_point",
|
303
|
-
"white_threshold",
|
304
|
-
"window",
|
305
|
-
"window_group"
|
306
|
-
].concat(ActiveStorage.supported_image_processing_methods)
|
307
|
-
|
308
|
-
UNSUPPORTED_IMAGE_PROCESSING_ARGUMENTS = ActiveStorage.unsupported_image_processing_arguments
|
309
18
|
|
310
19
|
def process(file, format:)
|
311
20
|
processor.
|
@@ -340,9 +49,9 @@ module ActiveStorage
|
|
340
49
|
end
|
341
50
|
|
342
51
|
def validate_transformation(name, argument)
|
343
|
-
method_name = name.to_s.
|
52
|
+
method_name = name.to_s.tr("-", "_")
|
344
53
|
|
345
|
-
unless
|
54
|
+
unless ActiveStorage.supported_image_processing_methods.any? { |method| method_name == method }
|
346
55
|
raise UnsupportedImageProcessingMethod, <<~ERROR.squish
|
347
56
|
One or more of the provided transformation methods is not supported.
|
348
57
|
ERROR
|
@@ -360,7 +69,11 @@ module ActiveStorage
|
|
360
69
|
end
|
361
70
|
|
362
71
|
def validate_arg_string(argument)
|
363
|
-
|
72
|
+
unsupported_arguments = ActiveStorage.unsupported_image_processing_arguments.any? do |bad_arg|
|
73
|
+
argument.to_s.downcase.include?(bad_arg)
|
74
|
+
end
|
75
|
+
|
76
|
+
raise UnsupportedImageProcessingArgument if unsupported_arguments
|
364
77
|
end
|
365
78
|
|
366
79
|
def validate_arg_array(argument)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require_relative "gem_version"
|
4
4
|
|
5
5
|
module ActiveStorage
|
6
|
-
# Returns the version of
|
6
|
+
# Returns the currently loaded version of Active Storage as a <tt>Gem::Version</tt>.
|
7
7
|
def self.version
|
8
8
|
gem_version
|
9
9
|
end
|
data/lib/active_storage.rb
CHANGED
@@ -59,7 +59,295 @@ module ActiveStorage
|
|
59
59
|
mattr_accessor :content_types_to_serve_as_binary, default: []
|
60
60
|
mattr_accessor :content_types_allowed_inline, default: []
|
61
61
|
|
62
|
-
mattr_accessor :supported_image_processing_methods, default: [
|
62
|
+
mattr_accessor :supported_image_processing_methods, default: [
|
63
|
+
"adaptive_blur",
|
64
|
+
"adaptive_resize",
|
65
|
+
"adaptive_sharpen",
|
66
|
+
"adjoin",
|
67
|
+
"affine",
|
68
|
+
"alpha",
|
69
|
+
"annotate",
|
70
|
+
"antialias",
|
71
|
+
"append",
|
72
|
+
"apply",
|
73
|
+
"attenuate",
|
74
|
+
"authenticate",
|
75
|
+
"auto_gamma",
|
76
|
+
"auto_level",
|
77
|
+
"auto_orient",
|
78
|
+
"auto_threshold",
|
79
|
+
"backdrop",
|
80
|
+
"background",
|
81
|
+
"bench",
|
82
|
+
"bias",
|
83
|
+
"bilateral_blur",
|
84
|
+
"black_point_compensation",
|
85
|
+
"black_threshold",
|
86
|
+
"blend",
|
87
|
+
"blue_primary",
|
88
|
+
"blue_shift",
|
89
|
+
"blur",
|
90
|
+
"border",
|
91
|
+
"bordercolor",
|
92
|
+
"borderwidth",
|
93
|
+
"brightness_contrast",
|
94
|
+
"cache",
|
95
|
+
"canny",
|
96
|
+
"caption",
|
97
|
+
"channel",
|
98
|
+
"channel_fx",
|
99
|
+
"charcoal",
|
100
|
+
"chop",
|
101
|
+
"clahe",
|
102
|
+
"clamp",
|
103
|
+
"clip",
|
104
|
+
"clip_path",
|
105
|
+
"clone",
|
106
|
+
"clut",
|
107
|
+
"coalesce",
|
108
|
+
"colorize",
|
109
|
+
"colormap",
|
110
|
+
"color_matrix",
|
111
|
+
"colors",
|
112
|
+
"colorspace",
|
113
|
+
"colourspace",
|
114
|
+
"color_threshold",
|
115
|
+
"combine",
|
116
|
+
"combine_options",
|
117
|
+
"comment",
|
118
|
+
"compare",
|
119
|
+
"complex",
|
120
|
+
"compose",
|
121
|
+
"composite",
|
122
|
+
"compress",
|
123
|
+
"connected_components",
|
124
|
+
"contrast",
|
125
|
+
"contrast_stretch",
|
126
|
+
"convert",
|
127
|
+
"convolve",
|
128
|
+
"copy",
|
129
|
+
"crop",
|
130
|
+
"cycle",
|
131
|
+
"deconstruct",
|
132
|
+
"define",
|
133
|
+
"delay",
|
134
|
+
"delete",
|
135
|
+
"density",
|
136
|
+
"depth",
|
137
|
+
"descend",
|
138
|
+
"deskew",
|
139
|
+
"despeckle",
|
140
|
+
"direction",
|
141
|
+
"displace",
|
142
|
+
"dispose",
|
143
|
+
"dissimilarity_threshold",
|
144
|
+
"dissolve",
|
145
|
+
"distort",
|
146
|
+
"dither",
|
147
|
+
"draw",
|
148
|
+
"duplicate",
|
149
|
+
"edge",
|
150
|
+
"emboss",
|
151
|
+
"encoding",
|
152
|
+
"endian",
|
153
|
+
"enhance",
|
154
|
+
"equalize",
|
155
|
+
"evaluate",
|
156
|
+
"evaluate_sequence",
|
157
|
+
"extent",
|
158
|
+
"extract",
|
159
|
+
"family",
|
160
|
+
"features",
|
161
|
+
"fft",
|
162
|
+
"fill",
|
163
|
+
"filter",
|
164
|
+
"flatten",
|
165
|
+
"flip",
|
166
|
+
"floodfill",
|
167
|
+
"flop",
|
168
|
+
"font",
|
169
|
+
"foreground",
|
170
|
+
"format",
|
171
|
+
"frame",
|
172
|
+
"function",
|
173
|
+
"fuzz",
|
174
|
+
"fx",
|
175
|
+
"gamma",
|
176
|
+
"gaussian_blur",
|
177
|
+
"geometry",
|
178
|
+
"gravity",
|
179
|
+
"grayscale",
|
180
|
+
"green_primary",
|
181
|
+
"hald_clut",
|
182
|
+
"highlight_color",
|
183
|
+
"hough_lines",
|
184
|
+
"iconGeometry",
|
185
|
+
"iconic",
|
186
|
+
"identify",
|
187
|
+
"ift",
|
188
|
+
"illuminant",
|
189
|
+
"immutable",
|
190
|
+
"implode",
|
191
|
+
"insert",
|
192
|
+
"intensity",
|
193
|
+
"intent",
|
194
|
+
"interlace",
|
195
|
+
"interline_spacing",
|
196
|
+
"interpolate",
|
197
|
+
"interpolative_resize",
|
198
|
+
"interword_spacing",
|
199
|
+
"kerning",
|
200
|
+
"kmeans",
|
201
|
+
"kuwahara",
|
202
|
+
"label",
|
203
|
+
"lat",
|
204
|
+
"layers",
|
205
|
+
"level",
|
206
|
+
"level_colors",
|
207
|
+
"limit",
|
208
|
+
"limits",
|
209
|
+
"linear_stretch",
|
210
|
+
"linewidth",
|
211
|
+
"liquid_rescale",
|
212
|
+
"list",
|
213
|
+
"loader",
|
214
|
+
"log",
|
215
|
+
"loop",
|
216
|
+
"lowlight_color",
|
217
|
+
"magnify",
|
218
|
+
"map",
|
219
|
+
"mattecolor",
|
220
|
+
"median",
|
221
|
+
"mean_shift",
|
222
|
+
"metric",
|
223
|
+
"mode",
|
224
|
+
"modulate",
|
225
|
+
"moments",
|
226
|
+
"monitor",
|
227
|
+
"monochrome",
|
228
|
+
"morph",
|
229
|
+
"morphology",
|
230
|
+
"mosaic",
|
231
|
+
"motion_blur",
|
232
|
+
"name",
|
233
|
+
"negate",
|
234
|
+
"noise",
|
235
|
+
"normalize",
|
236
|
+
"opaque",
|
237
|
+
"ordered_dither",
|
238
|
+
"orient",
|
239
|
+
"page",
|
240
|
+
"paint",
|
241
|
+
"pause",
|
242
|
+
"perceptible",
|
243
|
+
"ping",
|
244
|
+
"pointsize",
|
245
|
+
"polaroid",
|
246
|
+
"poly",
|
247
|
+
"posterize",
|
248
|
+
"precision",
|
249
|
+
"preview",
|
250
|
+
"process",
|
251
|
+
"quality",
|
252
|
+
"quantize",
|
253
|
+
"quiet",
|
254
|
+
"radial_blur",
|
255
|
+
"raise",
|
256
|
+
"random_threshold",
|
257
|
+
"range_threshold",
|
258
|
+
"red_primary",
|
259
|
+
"regard_warnings",
|
260
|
+
"region",
|
261
|
+
"remote",
|
262
|
+
"render",
|
263
|
+
"repage",
|
264
|
+
"resample",
|
265
|
+
"resize",
|
266
|
+
"resize_to_fill",
|
267
|
+
"resize_to_fit",
|
268
|
+
"resize_to_limit",
|
269
|
+
"resize_and_pad",
|
270
|
+
"respect_parentheses",
|
271
|
+
"reverse",
|
272
|
+
"roll",
|
273
|
+
"rotate",
|
274
|
+
"sample",
|
275
|
+
"sampling_factor",
|
276
|
+
"saver",
|
277
|
+
"scale",
|
278
|
+
"scene",
|
279
|
+
"screen",
|
280
|
+
"seed",
|
281
|
+
"segment",
|
282
|
+
"selective_blur",
|
283
|
+
"separate",
|
284
|
+
"sepia_tone",
|
285
|
+
"shade",
|
286
|
+
"shadow",
|
287
|
+
"shared_memory",
|
288
|
+
"sharpen",
|
289
|
+
"shave",
|
290
|
+
"shear",
|
291
|
+
"sigmoidal_contrast",
|
292
|
+
"silent",
|
293
|
+
"similarity_threshold",
|
294
|
+
"size",
|
295
|
+
"sketch",
|
296
|
+
"smush",
|
297
|
+
"snaps",
|
298
|
+
"solarize",
|
299
|
+
"sort_pixels",
|
300
|
+
"sparse_color",
|
301
|
+
"splice",
|
302
|
+
"spread",
|
303
|
+
"statistic",
|
304
|
+
"stegano",
|
305
|
+
"stereo",
|
306
|
+
"storage_type",
|
307
|
+
"stretch",
|
308
|
+
"strip",
|
309
|
+
"stroke",
|
310
|
+
"strokewidth",
|
311
|
+
"style",
|
312
|
+
"subimage_search",
|
313
|
+
"swap",
|
314
|
+
"swirl",
|
315
|
+
"synchronize",
|
316
|
+
"taint",
|
317
|
+
"text_font",
|
318
|
+
"threshold",
|
319
|
+
"thumbnail",
|
320
|
+
"tile_offset",
|
321
|
+
"tint",
|
322
|
+
"title",
|
323
|
+
"transform",
|
324
|
+
"transparent",
|
325
|
+
"transparent_color",
|
326
|
+
"transpose",
|
327
|
+
"transverse",
|
328
|
+
"treedepth",
|
329
|
+
"trim",
|
330
|
+
"type",
|
331
|
+
"undercolor",
|
332
|
+
"unique_colors",
|
333
|
+
"units",
|
334
|
+
"unsharp",
|
335
|
+
"update",
|
336
|
+
"valid_image",
|
337
|
+
"view",
|
338
|
+
"vignette",
|
339
|
+
"virtual_pixel",
|
340
|
+
"visual",
|
341
|
+
"watermark",
|
342
|
+
"wave",
|
343
|
+
"wavelet_denoise",
|
344
|
+
"weight",
|
345
|
+
"white_balance",
|
346
|
+
"white_point",
|
347
|
+
"white_threshold",
|
348
|
+
"window",
|
349
|
+
"window_group"
|
350
|
+
]
|
63
351
|
mattr_accessor :unsupported_image_processing_arguments
|
64
352
|
|
65
353
|
mattr_accessor :service_urls_expire_in, default: 5.minutes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.0.
|
19
|
+
version: 7.0.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.0.
|
26
|
+
version: 7.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 7.0.
|
33
|
+
version: 7.0.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 7.0.
|
40
|
+
version: 7.0.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activejob
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 7.0.
|
47
|
+
version: 7.0.4
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 7.0.
|
54
|
+
version: 7.0.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activerecord
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 7.0.
|
61
|
+
version: 7.0.4
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 7.0.
|
68
|
+
version: 7.0.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: marcel
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,10 +198,10 @@ licenses:
|
|
198
198
|
- MIT
|
199
199
|
metadata:
|
200
200
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
201
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
202
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
201
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.4/activestorage/CHANGELOG.md
|
202
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.4/
|
203
203
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
204
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
204
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.4/activestorage
|
205
205
|
rubygems_mfa_required: 'true'
|
206
206
|
post_install_message:
|
207
207
|
rdoc_options: []
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
|
-
rubygems_version: 3.
|
221
|
+
rubygems_version: 3.3.3
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Local and cloud file storage framework.
|