-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Active Storage for Picture and File attachments #2544
Conversation
7fc3de3
to
9e46ec4
Compare
This pull request has not seen any activiy in a long time. |
e6bcf92
to
fe22999
Compare
Necessary for active storage image transforms
ActiveStorage uses the image_processing gem to process images. This uses a hash to describe the conversion instead of a string
Instead of using the Dragonfly Model validations we write our own. That way we can use another image attachment library more easily
The vips image_processing processor sharpens images by default. This disables this behavior.
Active storage already knows if a file is convertible
This avoids N+1 in the image library
Using activestorage methods to read the values. Ideally we would cache these values, but active storage asynchronously sets these values and provides no callback we could use.
Now that we use ActiveStorage we can remove our custom picture variant handling
This method is the only one left after the PictureVariant and PictureThumb removal.
Active storage has the mime type stored not the extension.
ruby-vips and mini_magick need to be told to ignore the page in order to resize animated gifs.
Before we where not telling active storage that we want a certain format explicitely. We need that for displaying animated PNGs properly.
Proxy downloads the file.
Rails only adds it in Rails 7.1
8e7b45e
to
6fd573d
Compare
Only works in Rails 7.1
6fd573d
to
6b5b532
Compare
4ea5c7d
to
19e4094
Compare
This pull request has not seen any activiy in a long time. |
This pull request has not seen any activiy in a long time. |
What is this pull request for?
Reworks #2288
Use ActiveStorage instead of Dragonfly for picture and file attachments.
Important changes
vips
. It works withmini_magick
thoughTODO
Alchemy::Attachment
as wellmini_magick
use proxy instead of redirectChecklist