BUG:16-bit grayscale TIFF images fail thumbnail generation and are silently skipped during indexing
メンテナーはふだん 4 日以内に返信
@Krishna081207 がすでに取り組んでいます。
2026年11月26日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 322
- フォーク
- 793
- 平均マージ
- 6日 9時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)対応中かも @jayssSmm が 1 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/PictoPy#1780 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't work対応中かも @swastiksharma45 が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/PictoPy#1779 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is off対応中かも @dhruvbit が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AOSSIE-Org/PictoPy#1770 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @riyanshbhosale が 5 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: /sync-folder does not validate the supplied folder_id再び着手できるかも @sathvikn113 が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/PictoPy#1731 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
cofade/open-garden-planner#1044 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
codecrafters-io/build-your-own-x#2126 ·
メンテナーはふだん 5 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NatronGitHub/Natron#2029 ·
メンテナーはふだん 1 日以内に返信