BUG: Unreadable images interrupt the entire AI-tagging process
Maintainers usually reply within 6 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- opencv, python
- Domain
- backend, machine-learning
Research direction
Start with backend/app/models/ObjectClassifier.py and backend/app/utils/images.py; trace how get_classes() handles an image that OpenCV cannot load and how the tagging loop updates isTagged. Check the existing tests for image classification and batch processing. Done means unreadable images are skipped without ending the batch, while successfully processed images with no detections are marked tagged.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Description
The AI-tagging process can terminate unexpectedly when PictoPy encounters an image that OpenCV cannot load or decode(corrupt or unsupported image).
In ObjectClassifier.get_classes() (backend/app/models/ObjectClassifier.py), cv2.imread() returns None when an image cannot be loaded. However, image_util_classify_and_face_detect_images() (backend/app/utils/images.py) directly calls len(classes) without checking for None, resulting in a TypeError that interrupts the entire tagging batch.
Expected Behaviour
- Unreadable images should be logged and skipped.
- Their isTagged status should remain False.
- Processing should continue with the remaining images.
- Successfully processed images with no detections should still be marked as tagged.
Actual behaviour
- Application retrieves multiple untagged images from the database.
- YOLO processes images sequentially.
- One image is corrupt or unreadable.
- get_classes() returns None.
- len(None) raises a TypeError.
- The entire tagging batch terminates.
- Remaining images are not processed during that run.
Why Does This Matter?
A single unreadable image can prevent an entire batch of otherwise valid images from receiving AI-generated tags. Handling such failures individually would improve the reliability and stability of PictoPy's AI-tagging pipeline.
Proposed Solution
Handle the None return value before accessing len(classes). Skip the unreadable image and continue processing the remaining images.
Record
- I agree to follow this project's Code of Conduct
- Dominant language
- Python
- Stars
- 313
- Forks
- 755
- Avg merge
- 6d 36m
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/PictoPy
-
enhancement possible-duplicate
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/PictoPy#1715 · 2 comments ·
Maintainers usually reply within 6 days
-
BUG: /folders/all-folders takes over a second when folders contain both images and videosPossibly taken @Saurabhyadav0 claimed this 1 day ago. Openbug enhancement possible-duplicate
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AOSSIE-Org/PictoPy#1708 · 3 comments ·
Maintainers usually reply within 6 days
-
Add unit tests for personUtils.tsPossibly taken @mystic-fae claimed this today. Openenhancement
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/PictoPy#1707 · 3 comments ·
Maintainers usually reply within 6 days
-
bug possible-duplicate
Difficulty 1/5 Under an hour Newbie friendliness 86/100
AOSSIE-Org/PictoPy#1700 · 3 comments ·
Maintainers usually reply within 6 days
-
BUG: Share page returns HTTP 500 when the unlock cookie contains a non-ASCII characterMay be free again @swastiksharma45 claimed this 7 days ago, and no pull request is open. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AOSSIE-Org/PictoPy#1696 · 6 comments ·
Maintainers usually reply within 6 days
All issues in AOSSIE-Org/PictoPy
Similar issues
-
add entry to blockOpen
Difficulty 1/5 Under an hour Newbie friendliness 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Possibly taken @0z5a claimed this today. Openneeds-triage
Difficulty 2/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
future-agi/future-agi#4092 · 1 comment ·
Maintainers usually reply within 1 day
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeOpen
Difficulty 1/5 Under an hour Newbie friendliness 82/100
WingedGuardian/GENesis-AGI#4641 ·
Maintainers usually reply within 1 day