BUG:16-bit grayscale TIFF images fail thumbnail generation and are silently skipped during indexing
Maintainer thường phản hồi trong vòng 4 ngày
@Krishna081207 đang làm issue này rồi.
Từ ngày 26/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Start by tracing TIFF thumbnail generation and the Pillow/SigLIP loader under backend/app/utils and the model preprocessing paths; the issue does not name specific files or tests. Compare how each path handles a synthetic I;16 TIFF, then check indexing and model inputs after normalization. Done means indexing creates a thumbnail and database record, and YOLO, FaceNet, and SigLIP receive consistent 8-bit RGB inputs.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
What happened?
PictoPy added TIFF support in #1532, and standard 8-bit/CMYK TIFFs generate thumbnails and index normally. However, 16-bit grayscale TIFFs (I;16) fail during thumbnail generation with:
OSError: cannot write mode I;16 as JPEG
Because thumbnail generation fails, normal folder indexing silently skips the image without inserting a DB record or queuing it for AI processing.
Additionally, if a 16-bit grayscale TIFF is passed directly to the model loaders, the two decoding paths behave inconsistently:
OpenCV (YOLO / FaceNet) downscales it to mid-gray.
Pillow (SigLIP) clips 16-bit pixel values (> 255) to pure white (255) on .convert("RGB").
Steps to Reproduce
Place a 16-bit grayscale .tiff (Pillow mode I;16) in a tracked folder.
Run folder indexing / thumbnail generation.
Observe OSError: cannot write mode I;16 as JPEG and note that no record is inserted into the database.
Pass the same file directly into the OpenCV (YOLO/FaceNet) and Pillow (SigLIP) preprocessing paths and compare the resulting RGB arrays.
Expected Behavior
16-bit grayscale TIFFs (I;16) should be downscaled to 8-bit (uint8, 0–255) before JPEG thumbnail creation and before passing to Pillow/SigLIP.
Normal folder indexing should successfully generate thumbnails, insert the image record, and produce consistent 8-bit RGB inputs across YOLO, FaceNet, and SigLIP.
Suggested Fix
Add a shared 16-bit-safe Pillow normalization helper in backend/app/utils/ (e.g., scaling I;16 down to 8-bit via img.point(lambda i: i >> 8).convert("L").convert("RGB") or NumPy (arr >> 8).astype(np.uint8) before JPEG save / RGB conversion).
Use it in both thumbnail generation and the SigLIP Pillow loader so OpenCV and Pillow paths produce consistent 8-bit RGB images.
Add pytest regression tests using a synthetic I;16 TIFF fixture covering thumbnail generation, indexing, and model input normalization.
Environment
Branch: dev
OS: Windows
Related: #1646, #1532
Record
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Python
- Star
- 322
- Fork
- 793
- Merge trung bình
- 6 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/PictoPy
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Có thể đã có người làm @jayssSmm đã nhận 1 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/PictoPy#1780 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workCó thể đã có người làm @swastiksharma45 đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AOSSIE-Org/PictoPy#1779 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is offCó thể đã có người làm @dhruvbit đã nhận 3 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AOSSIE-Org/PictoPy#1770 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: Add images to album: success message shows requested count, not number actually addedCó thể đã có người làm @riyanshbhosale đã nhận 5 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AOSSIE-Org/PictoPy#1740 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: /sync-folder does not validate the supplied folder_idCó thể làm lại được @sathvikn113 đã nhận 10 ngày trước và không có pull request nào đang mở. Đang mởbug possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/PictoPy#1731 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của AOSSIE-Org/PictoPy
Issue tương tự
-
S2-12 Atualizar README.mdĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
bug help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
cofade/open-garden-planner#1044 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
python-commandline-toolsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
codecrafters-io/build-your-own-x#2126 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NatronGitHub/Natron#2029 ·
Maintainer thường phản hồi trong vòng 1 ngày