Skip to content

Conversation

@skyforge-glitch
Copy link

@skyforge-glitch skyforge-glitch commented Jan 8, 2026

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

  • Allow .webp images in backend image validation
  • Update UI empty-state text to reflect WebP support

Notes

  • Folder-based imports rely on backend validation only, so no frontend upload changes were required
  • Existing PNG/JPG/JPEG functionality remains unaffected

Testing

  • Imported folders containing WebP images
  • Verified WebP images are visible and processed correctly

Summary by CodeRabbit

Release Notes

  • New Features

    • Extended image format support to include WebP, allowing users to upload WebP images in addition to PNG, JPG, and JPEG formats.
  • UI Improvements

    • Updated help text and empty state messages to inform users that WebP format is now supported for image uploads and processing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

Added WebP image format support by extending backend validation to accept .webp file extensions and updating frontend UI text to reflect the new supported format across image upload and gallery display components.

Changes

Cohort / File(s) Change Summary
Backend Validation
backend/app/utils/images.py
Extended image_util_is_valid_image allowed extensions list to include .webp alongside existing .jpg, .jpeg, and .png formats
Frontend UI Text Updates
frontend/src/components/EmptyStates/EmptyAITaggingState.tsx, frontend/src/components/EmptyStates/EmptyGalleryState.tsx
Updated user-facing format support messages from "Supports PNG, JPG, JPEG image formats." to "Supports PNG, JPG, JPEG, WebP image formats."

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A whisker-twitching hop of joy—
WebP joins the format crew!
From PNG, JPG, JPEG's employ,
Now modern images shine bright and true! 🖼️✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly describes the main change: enabling WebP image support in backend validation, which aligns with the primary objective of the changeset.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #973: backend validation extended for .webp, frontend UI updated with WebP support text, Pillow compatibility maintained, and existing functionality unaffected.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #973 objectives: backend validation extension, UI text updates, with no modifications to ML pipelines, database schema, or processing logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added backend enhancement New feature or request labels Jan 8, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between a3af96c and d052a7d.

📒 Files selected for processing (3)
  • backend/app/utils/images.py
  • frontend/src/components/EmptyStates/EmptyAITaggingState.tsx
  • frontend/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 .webp to allowed_extensions in image_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.

@skyforge-glitch
Copy link
Author

Hi @rahulharpal1603 , I’ve opened a PR that adds WebP image support by extending backend validation and updating the UI text.
The fix is scoped to validation only (no ML or clustering changes).
Would really appreciate your review whenever you get time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Add WebP Image Format Support

1 participant