-
Notifications
You must be signed in to change notification settings - Fork 10
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
Centralize Abstraction for Thumbnail Generation #1343
Comments
jupiter/app/models/community.rb Lines 51 to 56 in 6c44b32
jupiter/app/models/jupiter_core/depositable.rb Lines 99 to 118 in 2877fcb
jupiter/app/models/concerns/draft_properties.rb Lines 53 to 64 in be07bda
jupiter/app/views/items/draft/_thumbnail.html.erb Lines 2 to 17 in f9c878a
jupiter/app/views/admin/theses/draft/_thumbnail.html.erb Lines 2 to 17 in f9c878a
|
Here's the rough approach:
|
Merged into postmigration branch. |
Right now we call ActiveStorage's
variant
andpreview
methods in a variety of places , with inconsistent error handling. This is leading to issues where an invalid or corrupted JPEG or other unknown format issue can lead to a page or search 500ing when it attempts to display a thumbnail for the file.Arguably, calling into ActiveStorage for variants through the items and theses and communitiers and drafts that own these files is a law of demeter violation, and it's that anti-pattern that's at the root of our inability to correctly handle these errors. We should set up a single "clearing house" method for thumbnails across models that can abstract away the variant generation and handle errors consistently and easily.
If you're going to work on this please grab @mbarnett so that we can whiteboard out approaches and come up with a good, scalable solution that will serve us well down the road.
The text was updated successfully, but these errors were encountered: