Skip to content

Commit e80bdd5

Browse files
committed
Use image_file_extension as original format
ActiveStorage expects an extension and not an mime type.
1 parent 501552c commit e80bdd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/alchemy/picture.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def thumbnail_url(size: "160x120")
208208

209209
url(
210210
flatten: true,
211-
format: image_file_format || "jpg",
211+
format: image_file_extension || "jpg",
212212
size: size
213213
)
214214
end

app/models/concerns/alchemy/picture_thumbnails.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def thumbnail_url_options
8484
crop_from: crop && crop_from.presence || default_crop_from&.join("x"),
8585
crop_size: crop && crop_size.presence || default_crop_size&.join("x"),
8686
flatten: true,
87-
format: picture&.image_file_format || "jpg"
87+
format: picture&.image_file_extension || "jpg"
8888
}
8989
end
9090

0 commit comments

Comments
 (0)