-
Notifications
You must be signed in to change notification settings - Fork 343
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
Resize facility cover image before upload #1106
Conversation
Codecov ReportBase: 55.89% // Head: 55.84% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1106 +/- ##
==========================================
- Coverage 55.89% 55.84% -0.05%
==========================================
Files 175 175
Lines 8711 8727 +16
Branches 1475 1491 +16
==========================================
+ Hits 4869 4874 +5
- Misses 3790 3801 +11
Partials 52 52
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Kudos, SonarCloud Quality Gate passed!
|
) | ||
|
||
img = Image.open(image) | ||
img.thumbnail((720, 720)) |
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.
can we only allow images of this ratio to be uploaded in the FE? ( Square ) Anything not in this ration would look weird right?
@@ -132,18 +135,41 @@ class Meta: | |||
# Check DRYpermissions before updating | |||
fields = ("cover_image", "read_cover_image_url") | |||
|
|||
def resize_image(self, image, image_extension="PNG"): | |||
image_format = ( | |||
"JPEG" if image_extension.lower() == "jpg" else image_extension.upper() |
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.
why are we moving to uppercase?
This PR will be marked stale and closed within the next 2 days. |
can we add a basic image tool to crop and resize the image, and then just check the size at the backend |
Proposed Changes
Associated Issue
Architecture changes
@coronasafe/code-reviewers
Merge Checklist
/docs