File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
app/models/active_storage Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 75
75
activerecord (= 7.0.0.alpha )
76
76
activesupport (= 7.0.0.alpha )
77
77
marcel (~> 1.0.0 )
78
- mini_mime (~> 1.0.2 )
78
+ mini_mime (>= 1.1.0 )
79
79
activesupport (7.0.0.alpha )
80
80
concurrent-ruby (~> 1.0 , >= 1.0.2 )
81
81
i18n (>= 1.6 , < 2 )
224
224
tzinfo
225
225
event_emitter (0.2.6 )
226
226
eventmachine (1.2.7 )
227
+ eventmachine (1.2.7-java )
228
+ eventmachine (1.2.7-x64-mingw32 )
229
+ eventmachine (1.2.7-x86-mingw32 )
227
230
execjs (2.7.0 )
228
231
faraday (1.3.0 )
229
232
faraday-net_http (~> 1.0 )
@@ -290,12 +293,14 @@ GEM
290
293
hiredis (0.6.3 )
291
294
hiredis (0.6.3-java )
292
295
http_parser.rb (0.6.0 )
296
+ http_parser.rb (0.6.0-java )
293
297
httpclient (2.8.3 )
294
298
i18n (1.8.7 )
295
299
concurrent-ruby (~> 1.0 )
296
300
image_processing (1.12.1 )
297
301
mini_magick (>= 4.9.5 , < 5 )
298
302
ruby-vips (>= 2.0.17 , < 3 )
303
+ jar-dependencies (0.4.1 )
299
304
jdbc-mysql (5.1.47 )
300
305
jdbc-postgres (42.2.14 )
301
306
jdbc-sqlite3 (3.28.0 )
307
312
mustache
308
313
nokogiri
309
314
libxml-ruby (3.2.1 )
315
+ libxml-ruby (3.2.1-x64-mingw32 )
310
316
listen (3.4.1 )
311
317
rb-fsevent (~> 0.10 , >= 0.10.3 )
312
318
rb-inotify (~> 0.9 , >= 0.9.10 )
319
325
memoist (0.16.2 )
320
326
method_source (1.0.0 )
321
327
mini_magick (4.11.0 )
322
- mini_mime (1.0.2 )
328
+ mini_mime (1.1.0 )
323
329
mini_portile2 (2.5.0 )
324
330
minitest (5.14.3 )
325
331
minitest-bisect (1.5.1 )
368
374
pg (1.2.3-x64-mingw32 )
369
375
pg (1.2.3-x86-mingw32 )
370
376
psych (3.3.0 )
377
+ psych (3.3.0-java )
378
+ jar-dependencies (>= 0.1.7 )
371
379
public_suffix (4.0.6 )
372
380
puma (5.1.1 )
373
381
nio4r (~> 2.0 )
@@ -636,4 +644,4 @@ DEPENDENCIES
636
644
websocket-client-simple !
637
645
638
646
BUNDLED WITH
639
- 2.2.3
647
+ 2.2.15
Original file line number Diff line number Diff line change @@ -37,5 +37,5 @@ Gem::Specification.new do |s|
37
37
s . add_dependency "activerecord" , version
38
38
39
39
s . add_dependency "marcel" , "~> 1.0.0"
40
- s . add_dependency "mini_mime" , "~> 1.0.2 "
40
+ s . add_dependency "mini_mime" , ">= 1.1.0 "
41
41
end
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ def download(&block)
89
89
end
90
90
91
91
def filename
92
- ActiveStorage ::Filename . new "#{ blob . filename . base } .#{ variation . format } "
92
+ ActiveStorage ::Filename . new "#{ blob . filename . base } .#{ variation . format . downcase } "
93
93
end
94
94
95
95
alias_method :content_type_for_serving , :content_type
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def image
33
33
def transform_blob
34
34
blob . open do |input |
35
35
variation . transform ( input ) do |output |
36
- yield io : output , filename : "#{ blob . filename . base } .#{ variation . format } " ,
36
+ yield io : output , filename : "#{ blob . filename . base } .#{ variation . format . downcase } " ,
37
37
content_type : variation . content_type , service_name : blob . service . name
38
38
end
39
39
end
Original file line number Diff line number Diff line change @@ -122,14 +122,22 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
122
122
end
123
123
end
124
124
125
- test "PNG variation of JPEG blob" do
125
+ test "PNG variation of JPEG blob with lowercase format " do
126
126
blob = create_file_blob ( filename : "racecar.jpg" )
127
127
variant = blob . variant ( format : :png ) . processed
128
128
assert_equal "racecar.png" , variant . filename . to_s
129
129
assert_equal "image/png" , variant . content_type
130
130
assert_equal "PNG" , read_image ( variant ) . type
131
131
end
132
132
133
+ test "PNG variation of JPEG blob with uppercase format" do
134
+ blob = create_file_blob ( filename : "racecar.jpg" )
135
+ variant = blob . variant ( format : "PNG" ) . processed
136
+ assert_equal "racecar.png" , variant . filename . to_s
137
+ assert_equal "image/png" , variant . content_type
138
+ assert_equal "PNG" , read_image ( variant ) . type
139
+ end
140
+
133
141
test "variation of invariable blob" do
134
142
assert_raises ActiveStorage ::InvariableError do
135
143
create_file_blob ( filename : "report.pdf" , content_type : "application/pdf" ) . variant ( resize : "100x100" )
You can’t perform that action at this time.
0 commit comments