-
Notifications
You must be signed in to change notification settings - Fork 0
Feature tiff support #32
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
Conversation
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.
Pull Request Overview
This PR adds support for TIFF images to the application by implementing TIFF file upload capabilities and enhancing image processing workflows.
- Updated file upload interface to accept TIFF files
- Added image validation using PIL to ensure uploaded files are valid images
- Standardized thumbnail generation to JPEG format for web compatibility
- Moved image classification display to the metadata section for better UI organization
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
frontend/src/components/ImageUploader.js | Added TIFF file types to accepted file formats in file input |
backend/routers/images.py | Added PIL-based image validation and standardized thumbnail format to JPEG |
frontend/src/components/ProjectReport.js | Moved classification display to metadata section and ensured classifications are loaded |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
backend/routers/images.py
Outdated
img.verify() # Verify the image is valid | ||
file.file.seek(0) # Reset position after verification | ||
logger.info("Image validation successful", extra={"format": img.format, "size": img.size}) |
Copilot
AI
Sep 27, 2025
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.
After calling img.verify()
, the PIL Image object becomes unusable and accessing img.format
and img.size
in the success log will fail. Move the logging of image properties before the verify() call or reopen the image after verification.
img.verify() # Verify the image is valid | |
file.file.seek(0) # Reset position after verification | |
logger.info("Image validation successful", extra={"format": img.format, "size": img.size}) | |
logger.info("Image validation successful", extra={"format": img.format, "size": img.size}) | |
img.verify() # Verify the image is valid | |
file.file.seek(0) # Reset position after verification |
Copilot uses AI. Check for mistakes.
<span><strong>Size:</strong> {formatFileSize(image.size_bytes)}</span> | ||
<span><strong>Type:</strong> {image.content_type || 'Unknown'}</span> | ||
<span><strong>Uploaded:</strong> {new Date(image.created_at).toLocaleString()}</span> | ||
<span><strong>Class Labels:</strong> {image.classifications && image.classifications.length > 0 ? image.classifications.map(c => classes.find(cls => cls.id === c.class_id)?.name || 'Unknown').join(', ') : 'None'}</span> |
Copilot
AI
Sep 27, 2025
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.
[nitpick] This line is overly complex and hard to read. Consider extracting the classification mapping logic into a separate function or breaking it into multiple lines for better readability.
Copilot uses AI. Check for mistakes.
No description provided.