Skip to content

[Fix] Remove confirmation status and "done" icon after image rotation#216

Merged
GreatV merged 1 commit intoPFCCLab:mainfrom
GreatV:fix_image_rotation
Sep 23, 2025
Merged

[Fix] Remove confirmation status and "done" icon after image rotation#216
GreatV merged 1 commit intoPFCCLab:mainfrom
GreatV:fix_image_rotation

Conversation

@GreatV
Copy link
Collaborator

@GreatV GreatV commented Sep 23, 2025

This pull request updates the image rotation functionality to ensure that after rotating an image, its confirmation status is cleared and the "done" icon is removed from the file list. This helps prevent confusion by indicating that the image needs to be reviewed again after modification.

Image rotation and status reset:

  • After rotating an image in rotateImg, the confirmation status is removed from fileStatedict for the affected image, ensuring that users are prompted to re-confirm the image.
  • The "done" icon is cleared from the file list for the rotated image, visually indicating that the image is no longer confirmed.

Copilot AI review requested due to automatic review settings September 23, 2025 13:04
@GreatV GreatV linked an issue Sep 23, 2025 that may be closed by this pull request
Copy link
Contributor

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 pull request fixes the image rotation functionality to properly reset the confirmation status and visual indicators after an image is rotated. This ensures users are prompted to re-review modified images.

  • Clears confirmation status from fileStatedict after image rotation
  • Removes the "done" icon from the file list widget for rotated images
  • Maintains visual consistency by indicating that rotated images need re-confirmation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


# Remove confirmation status after rotation
img_idx = self.getImglabelidx(filename)
if img_idx in self.fileStatedict:
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

The code should handle the case where getImglabelidx(filename) returns None or an invalid value. If img_idx is None, the in check will still pass but pop() could fail or behave unexpectedly.

Suggested change
if img_idx in self.fileStatedict:
if img_idx is not None and img_idx in self.fileStatedict:

Copilot uses AI. Check for mistakes.
Comment on lines +1409 to +1413
if filename in self.mImgList:
currIndex = self.mImgList.index(filename)
item = self.fileListWidget.item(currIndex)
if item:
item.setIcon(QIcon())
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

Using list.index() after checking membership with in results in two linear searches through the list. Store the index from the first search or use a try-catch block with index() directly to avoid the redundant search.

Suggested change
if filename in self.mImgList:
currIndex = self.mImgList.index(filename)
item = self.fileListWidget.item(currIndex)
if item:
item.setIcon(QIcon())
try:
currIndex = self.mImgList.index(filename)
item = self.fileListWidget.item(currIndex)
if item:
item.setIcon(QIcon())
except ValueError:
pass

Copilot uses AI. Check for mistakes.
@GreatV GreatV merged commit 17162f8 into PFCCLab:main Sep 23, 2025
1 check passed
@GreatV GreatV deleted the fix_image_rotation branch September 23, 2025 13:08
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.

能否对确认的图片进行取消确认?

2 participants