PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

BUG: Photos with non-ASCII file names and GIFs cannot be read by AI tagging and face detection on Windows

Open JIturiDashami opened this issue 3 weeks ago • 5 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

What happened?

On Windows, the app cannot open photos that have non-English letters in the file name (like café.jpg or a Hindi name), and it cannot open GIF files. So AI tagging and face detection skip these photos.

Why: these steps open photos with cv2.imread. With OpenCV 4.9.0 (the version in requirements.txt) on Windows it returns None for these files:

import cv2
cv2.imread(r"C:\photos\café.jpg")   # None
cv2.imread(r"C:\photos\photo.gif")  # None

A normal photo.jpg works, and PIL opens all of them.

Where: ObjectClassifier.get_classes, FaceDetector.detect_faces and the face thumbnail code in face_clusters.py.

Why it matters: many users have accents or Hindi in file names. Right now this causes the crash in #1496. After the fix in #1686, these photos will be skipped, so they still never get tags or faces.

Fix idea: one shared image loader. It reads the file with np.fromfile and cv2.imdecode, and falls back to PIL for GIF. I tested it on Windows: all these files load.

I would like to work on this!

Record

  • [x] I agree to follow this project's Code of Conduct

JIturiDashami avatar Nov 06 '26 09:11 JIturiDashami

👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)

github-actions[bot] avatar Nov 06 '26 09:11 github-actions[bot]

⚠️ Potential Duplicate Issue (Semantic Match)

This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:

  1. BUG: AI tagging aborts entire batch when encountering a corrupt/unreadable image (#1496, open) https://github.com/AOSSIE-Org/PictoPy/issues/1496 Similarity: 63.9%

  2. Performance: image_util_is_valid_image opens every image with PIL during folder scan, causing O(n) full reads on large libraries (#1409, open) https://github.com/AOSSIE-Org/PictoPy/issues/1409 Similarity: 58.3%

  3. BUG: TIFF photos can't be opened in the image viewer (#1692, open) https://github.com/AOSSIE-Org/PictoPy/issues/1692 Similarity: 57.9%

Please review before proceeding.

github-actions[bot] avatar Nov 06 '26 09:11 github-actions[bot]

Link your account with Gitcord

Thanks for opening this issue, @JIturiDashami!

To receive Discord notifications and contributor tracking for this organization:

  1. Join Discord: https://discord.gg/hjUhu33uAn
  2. In Discord, run /link JIturiDashami
  3. Paste the verification code into your GitHub bio (or a public gist)
  4. Click Verify in Discord (or run /verify-link JIturiDashami)

Once linked, Gitcord can notify you about assignments, mentions, and more.

— Posted by Gitcord

gitcordapp[bot] avatar Nov 07 '26 00:11 gitcordapp[bot]

@rohan-pandeyy i want to work on this issue can you assign it to me?

swastiksharma45 avatar Nov 07 '26 20:11 swastiksharma45

@swastiksharma45 I am waiting for the maintainer to check this issue and get it assigned, can you please check other issues ? Thanks for understanding!

JIturiDashami avatar Nov 08 '26 09:11 JIturiDashami