file in abyss
フォーマット一覧へ戻る

Image

TIF Tagged Image File Format

写真・印刷・スキャン用途で使われる画像形式。先頭でエンディアンと42マーカーを示します。

Extensions .tif, .tiff
MIME image/tiff

マジックナンバー

ファイルを解析
オフセット 0 Little-endian TIFF header
49 49 2A 00
II*.
オフセット 0 Big-endian TIFF header
4D 4D 00 2A
MM.*

構造

  1. Byte order marker
  2. TIFF marker
  3. IFD offset
  4. Image file directories
  5. Image data

注意点

  • BigTIFFは通常TIFFと異なるマーカーを持ちます。ExifもTIFF構造を内部で使います。

判定コード例

SIGNATURE = bytes.fromhex("49492a00")
OFFSET = 0

def is_tif(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Tagged Image File Format は画像のプレビュー、サムネイル、メタデータ確認、アップロード検証などで広く使われます。解像度・アルファ・圧縮・ファイルサイズが実装の挙動に影響するため、複数のサイズでテストしてください。

よくある判定ミス

  • .tif / .tiff という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Tagged Image File Format は 49 49 2A 00 または 4D 4D 00 2A のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

メディアファイルも、壊れたメタデータ・極端な寸法・長い再生時間・異常なチャンクでデコーダに負荷をかけることがあります。処理前にサイズ・寸法・長さを読み取ってください。

サンプルの活用

11 個のサンプルで、極小画像・高解像度画像・アルファチャンネル・圧縮しにくいアセットをテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Flower Garden TIFF preview

Flower Garden TIFF

Flower Garden TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 960 x 540. It can be used to test downloads, parsers, previews, and file type detection.

flower-garden.tiff
Resolution 960 x 540 518 Kpx
Preview
748 KB
SHA-256 88754b06e3ee17750e853bc38a4d6d94edcd0ed40e6dcceff4456de741e370b7
Download
Blue Sky TIFF preview

Blue Sky TIFF

Blue Sky TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 96 x 72. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.tiff
Resolution 96 x 72 7 Kpx
Preview
9.2 KB
SHA-256 983fb566be4e399e83c248c1623dd3896f3ad75d6d3f9b895cea56c1fb4c7158
Download
Flower Garden TIFF preview

Flower Garden TIFF

Flower Garden TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 160 x 90. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.tiff
Resolution 160 x 90 14 Kpx
Preview
25 KB
SHA-256 44ddf988932de1263418bd4b9b02026d791e416c1c4b223cd5bf534d104686ac
Download
Navy Blue Sky TIFF preview

Navy Blue Sky TIFF

Navy Blue Sky TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 256 x 128. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.tiff
Resolution 256 x 128 33 Kpx
Preview
34 KB
SHA-256 23bc959d76eb00664556ac73a68f52bc79adbfc80f59dfd6bb62fd3f6958531d
Download
Nature of the Sky TIFF preview

Nature of the Sky TIFF

Nature of the Sky TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 360 x 270. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.tiff
Resolution 360 x 270 97 Kpx
Preview
68 KB
SHA-256 ddfd15399aebbb258044ea3801c8a258cfdac932794d742ba67e71ad3782a9e2
Download
Sky Landscape TIFF preview

Sky Landscape TIFF

Sky Landscape TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 512 x 384. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.tiff
Resolution 512 x 384 197 Kpx
Preview
199 KB
SHA-256 e6ad834f63e2a7e8636b893ff519b49b31337e6e44adb3618dfbd51586ebdfc7
Download
Starry Sky TIFF preview

Starry Sky TIFF

Starry Sky TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 720 x 480. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.tiff
Resolution 720 x 480 346 Kpx
Preview
454 KB
SHA-256 31a075b8fb689e7bc18f4c2c22e3fa47bb055c874601e9c68ce747cae80b58ba
Download
Blue Night Sky TIFF preview

Blue Night Sky TIFF

Blue Night Sky TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 960 x 640. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.tiff
Resolution 960 x 640 614 Kpx
PreviewLarge file
1.84 MB
SHA-256 000918090886710faf9fdfa7441941dcc1abd3dbf4f255e21ebbcc7211392d35
Download
Hibiscus Flower TIFF preview

Hibiscus Flower TIFF

Hibiscus Flower TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 1280 x 2770. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.tiff
Resolution 1280 x 2770 3.5 MP
High resLarge file
4.99 MB
SHA-256 11c381ee8f13c7dcc1a7996f4f22aaae4edb51f7d35ac736d409e96f852da395
Download
Arctic Sky TIFF preview

Arctic Sky TIFF

Arctic Sky TIFF is a Tagged Image File Format sample based on Wikimedia Commons, 1600 x 1062. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.tiff
Resolution 1600 x 1062 1.7 MP
PreviewLarge file
4.45 MB
SHA-256 4ed27a4ede711743fa19c0c028e037695f79a8408631eea0eb6e3a13ffb15ac7
Download
NASA Blue Marble TIFF preview

NASA Blue Marble TIFF

NASA Blue Marble TIFF is a Tagged Image File Format sample based on NASA Image and Video Library, 640 x 640. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.tiff
Resolution 640 x 640 410 Kpx
Preview
381 KB
SHA-256 01c81929499c9f937d464d509f8ad7b7de931f7d7a0a021cf56f79e8aefb0ae4
Download

よくある質問

Tagged Image File Format のマジックナンバー(ファイルシグネチャ)は?

Tagged Image File Format ファイルはバイトシグネチャ 49 49 2A 00 ("II*.") または 4D 4D 00 2A ("MM.*") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Tagged Image File Format のMIMEタイプは?

Tagged Image File Format のMIMEタイプは image/tiff です。

Tagged Image File Format の拡張子は?

Tagged Image File Format ファイルは .tif, .tiff 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット