Skip to content

Commit

Permalink
Use image_file_extension as original format
Browse files Browse the repository at this point in the history
ActiveStorage expects an extension and not an mime type.
  • Loading branch information
tvdeyen committed Aug 4, 2024
1 parent 06c3c7d commit 897b217
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/alchemy/picture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def thumbnail_url(size: "160x120")

url(
flatten: true,
format: image_file_format || "jpg",
format: image_file_extension || "jpg",
size: size
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/alchemy/picture_thumbnails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def thumbnail_url_options
crop_from: crop && crop_from.presence || default_crop_from&.join("x"),
crop_size: crop && crop_size.presence || default_crop_size&.join("x"),
flatten: true,
format: picture&.image_file_format || "jpg"
format: picture&.image_file_extension || "jpg"
}
end

Expand Down

0 comments on commit 897b217

Please sign in to comment.