-
Notifications
You must be signed in to change notification settings - Fork 522
fix: enable WebP image support in backend validation #996
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: main
Are you sure you want to change the base?
fix: enable WebP image support in backend validation #996
Conversation
📝 WalkthroughWalkthroughAdded WebP image format support by extending backend validation to accept Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
backend/app/utils/images.py (1)
313-313: Minor spacing inconsistency in the set literal.Missing space after the comma before
".webp".♻️ Proposed fix
- allowed_extensions = {".jpg", ".jpeg", ".png",".webp"} + allowed_extensions = {".jpg", ".jpeg", ".png", ".webp"}
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
backend/app/utils/images.pyfrontend/src/components/EmptyStates/EmptyAITaggingState.tsxfrontend/src/components/EmptyStates/EmptyGalleryState.tsx
🔇 Additional comments (3)
frontend/src/components/EmptyStates/EmptyGalleryState.tsx (1)
23-23: LGTM! UI text correctly updated to reflect WebP support.The user-facing message now accurately lists WebP as a supported format, consistent with the backend validation changes.
frontend/src/components/EmptyStates/EmptyAITaggingState.tsx (1)
23-23: LGTM! UI text correctly updated to reflect WebP support.The message now includes WebP in the supported formats list, consistent with the backend validation and the other empty state component.
backend/app/utils/images.py (1)
313-318: Review comment is incorrect. PictoPy is a desktop application using folder selection, not file upload.The application uses Tauri folder picker dialogs where users select directories containing images. The backend scans these folders and filters by file extension—no direct file upload endpoints or frontend file input validation exist. The backend change adding
.webptoallowed_extensionsinimage_util_is_valid_image()is the only change needed. The PR's mention of "file picker upload" refers to folder selection, not HTTP file uploads, and there is no MIME type validation in the upload flow since the application scans existing local files.Likely an incorrect or invalid review comment.
|
Hi @rahulharpal1603 , I’ve opened a PR that adds WebP image support by extending backend validation and updating the UI text. |
Closes #973
Summary
This PR adds official WebP image support to PictoPy by extending backend image validation.
Pillow already supports WebP decoding, so no changes were required to the image processing,
tagging, or face clustering pipelines.
Changes
.webpimages in backend image validationNotes
Testing
Summary by CodeRabbit
Release Notes
New Features
UI Improvements
✏️ Tip: You can customize this high-level summary in your review settings.