Skip to content

Conversation

garland3
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings September 27, 2025 18:26
Copy link
Contributor

@Copilot Copilot AI left a 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.

Comment on lines 72 to 74
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})
Copy link

Copilot AI Sep 27, 2025

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.

Suggested change
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>
Copy link

Copilot AI Sep 27, 2025

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.

@garland3 garland3 merged commit af4cc7d into main Sep 27, 2025
9 of 10 checks passed
@garland3 garland3 deleted the FEATURE-tiff-support branch September 27, 2025 18:41
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.

1 participant