BUG: Corrupted image metadata causes HTTP 500, crashing the entire gallery view

オープン
#1,744 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 10 日以内に返信

@mystic-fae がすでに取り組んでいます。

2026年11月19日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

Read backend/AGENTS.md and compare the image handling in backend/app/routes/images.py (get_all_images() and search_images_by_tag()) with the validation handling in videos.py and video_util_to_video_data. Confirm how warnings are logged and how image records are validated. Done means a malformed record is logged and skipped while valid images still return successfully from both endpoints.

索引モデルが issue の本文から書いたものです。

説明

bug enhancement
Is there an existing issue for this?
  • I have searched the existing issues
What happened?

I noticed that in backend/app/routes/images.py (get_all_images() and search_images_by_tag()), the app builds the list of images using a direct list comprehension.

If even one photo in the database has corrupted or unexpected metadata, Pydantic throws a ValidationError. Because it's trapped in a bare list comprehension, that single bad record crashes the entire endpoint with an HTTP 500. As a result, the user's whole gallery fails to load.

Why we should fix it
The project's own rulebook in backend/AGENTS.md is super clear about this.

videos.py already handles this gracefully, but images.py is missing the pattern.

The proposed fix
We can update the loop in images.py to go row by row using a try/except block (just like video_util_to_video_data). If a row fails validation, we can log a warning with the image ID, skip it, and let the rest of the healthy photos load successfully with a 200 response instead of crashing.

I want to work on this issue and open a PR about this .
Can assign this to me?

Record
  • I agree to follow this project's Code of Conduct
主要言語
Python
スター
320
フォーク
771
平均マージ
9日 5時間
マージ済み PR(30日)
15

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/PictoPy のほかの issue

AOSSIE-Org/PictoPy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。