Tests: add real sample images (incl. HEIC) and cover HEIC in resize, convert and chains

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
testing-qa

調査の方向性

Start with tests/fixtures.py and the HEIC coverage in tests/test_info_cli.py and tests/test_info_helpers.py, then read the resize, convert, and chain tests. Add small real samples under tests/data/ and document their sources and upright dimensions in tests/data/README.md. Done means tests cover HEIC resize, conversion, the conversion-plus-resize chain, and rotated HEIC behavior, including GPS stripping where specified.

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

説明

Problem

The suite builds every test image on the fly with Pillow (tests/fixtures.py). That works well for isolated behavior, but two gaps showed up while preparing real photos with 1.7.0:

  1. HEIC is only tested through info. sample_heic_image and sample_jpeg_named_heic are used in tests/test_info_cli.py and tests/test_info_helpers.py only. Nothing covers resize on a HEIC, convert from HEIC, or a chain like convert --format jpg + resize. That chain works in practice (verified by hand on 2026-11-17), but no test would catch a regression.
  2. The synthetic HEIC has no orientation. create_heic_file saves a plain solid-color image. Real iPhone HEICs can carry rotation, and HEIF can express it in its own container transforms (irot/imir) as well as in EXIF. I have not verified how ipro and pillow-heif handle each case. The point is that no test exercises it. The orientation bug in #24 was invisible to programmatic checks until a real portrait photo hit it.

Proposal

Keep the generated fixtures, and add a small set of real sample files:

  • tests/data/ with 4-5 tiny files (a few KB each), for example:
    • portrait HEIC from an iPhone
    • landscape HEIC
    • JPG with EXIF Orientation=6 (iPhone portrait)
    • MPO from a recent iPhone (.JPG extension, multiple frames)
  • Shrink them (e.g. 200px) and strip GPS before committing. Use our own photos so licensing is clean.
  • Document each file's source device and expected upright dimensions in tests/data/README.md.

New tests:

  • resize HEIC: output is upright at the expected dimensions.
  • convert HEIC to JPG: upright, GPS stripped.
  • Chain convert --format jpg + resize --width N: both stages produce correct output.
  • Rotated real HEIC through resize and convert --strip-exif: stays upright.

Context

Follow-up to #24 and to a 24-photo batch on 2026-11-17 (4 HEIC, 8 rotated JPG). Related: #28, #29, #31.

— Emily

主要言語
Python
スター
1
フォーク
0
平均マージ
4時間 13分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

cadentdev/ipro のほかの issue

cadentdev/ipro の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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