-
Notifications
You must be signed in to change notification settings - Fork 0
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
feature/DEVSU-2543-auto-image-sizing #414
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #414 +/- ##
===========================================
- Coverage 76.96% 76.96% -0.01%
===========================================
Files 179 179
Lines 6038 6033 -5
Branches 696 696
===========================================
- Hits 4647 4643 -4
+ Misses 1314 1313 -1
Partials 77 77 ☔ View full report in Codecov by Sentry. |
@@ -57,4 +37,6 @@ module.exports = { | |||
MASTER_REPORT_ACCESS: ['admin', 'manager'], | |||
ALL_PROJECTS_ACCESS: ['admin', 'all projects access'], | |||
UPDATE_METHODS: ['POST', 'PUT', 'DELETE'], | |||
IMAGE_UPLOAD_LIMIT: 3000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to make these valuables configurable at runtime, with this as the default?
|
||
const result = await db.query( | ||
`SELECT | ||
SUM(pg_column_size("reports_image_data")) AS avg_size_bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: maybe call this total_bytes
// Process the image (resize and format) and update the size | ||
const resizedImage = await sharp(image.data) | ||
.resize( | ||
Math.floor(image.info.width / 1.5), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we also make the 1.5 configurable?
@@ -72,8 +72,6 @@ router.route('/:template([A-z0-9-]{36})') | |||
data: logo.data, | |||
filename: logo.name, | |||
format: logo.mimetype, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the frontend might need the logo and header to have a specific height and width, @kttkjl can you confirm/deny?
features: