Skip to content
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

Optimise images when they are uploaded and save in webp format #177

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

lkeegan
Copy link
Member

@lkeegan lkeegan commented Nov 19, 2024

  • backend
    • open uploaded images using pillow
    • resize if width > 1024
    • export to webp format using pywebp
    • add some png & jpeg files to the tests
  • frontend-admin
    • allow png uploads as well as jpg
  • frontend
    • update image urls
  • resolves Optimize image sizes #166

- backend
  - open uploaded images using pillow
  - resize if width > 1024
  - export to webp format using pywebp
  - add some png & jpeg files to the tests
- frontend-admin
  - allow png uploads as well as jpg
- frontend
  - update image urls
- resolves #166
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Project coverage is 30.09%. Comparing base (e355a44) to head (8e56030).

Files with missing lines Patch % Lines
frontend/src/lib/admin.svelte.ts 0.00% 1 Missing ⚠️
...src/lib/components/Admin/EditMilestoneModal.svelte 0.00% 1 Missing ⚠️
...nd/src/lib/components/Admin/MilestoneGroups.svelte 0.00% 1 Missing ⚠️
frontend/src/lib/components/Milestone.svelte 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   30.00%   30.09%   +0.08%     
==========================================
  Files          98       98              
  Lines        3236     3240       +4     
  Branches       86       86              
==========================================
+ Hits          971      975       +4     
  Misses       2194     2194              
  Partials       71       71              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@lkeegan lkeegan requested a review from MaHaWo November 19, 2024 10:01
Copy link
Collaborator

@MaHaWo MaHaWo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement. Code looks good, but it seems it breaks the childrengallery:

  • when I add an image for a child, it cannot be retrieved:
Error in server request
Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.

should we remove the image display for children altogether first? From the discussion about the default image I gathered that this is not desired anymore? Or did that just apply to the default image?

- automatically inferred type caused `Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.` runtime error in frontend
Copy link

sonarcloud bot commented Nov 20, 2024

@lkeegan
Copy link
Member Author

lkeegan commented Nov 20, 2024

Nice improvement. Code looks good, but it seems it breaks the childrengallery:

  • when I add an image for a child, it cannot be retrieved:
Error in server request
Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.

good catch - should be fixed by 8e56030

should we remove the image display for children altogether first? From the discussion about the default image I gathered that this is not desired anymore? Or did that just apply to the default image?

I understood that it only applied to the default image, which was not wanted, but we should still show an image if the user provides one.

@lkeegan lkeegan merged commit d7717bd into main Nov 20, 2024
6 checks passed
@lkeegan lkeegan deleted the fix_166_optimize_image_sizes branch November 20, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize image sizes
3 participants