-
Notifications
You must be signed in to change notification settings - Fork 3
FEATURE: automatically downsize large images #1
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
base: image-processing-optimization
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
User description
PR #1
PR Type
Enhancement
Description
Automatically downsize large images to allowed size during upload
Refactor OptimizedImage methods to use unified dimensions format
Increase client-side upload limit to 10MB for better UX
Add retry logic for image downsizing with up to 5 attempts
Diagram Walkthrough
File Walkthrough
uploads_controller.rb
Add automatic image downsizing on uploadapp/controllers/uploads_controller.rb
SiteSetting.max_image_size_kbto 10MBexceeding max allowed size
configured limit
optimized_image.rb
Refactor image optimization methods for consistencyapp/models/optimized_image.rb
resizeanddownsizemethods to format dimensions as stringbefore passing to
optimizedownsizemethod overload accepting pre-formatted dimensionsstring
optimizemethod to accept dimensions as single stringparameter
dimensionshelper method as formatting is now done inlineutilities.js
Increase client-side upload size limit to 10MBapp/assets/javascripts/discourse/lib/utilities.js
setting
10MB limit
downsizing