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

Image

WEBP WebP Image

Googleが開発したWeb向け画像形式。RIFFコンテナ内にWEBP form typeを持ちます。

Extensions .webp
MIME image/webp

マジックナンバー

ファイルを解析
オフセット 0 RIFF container with WEBP form type
52 49 46 46
RIFF

構造

  1. RIFF header
  2. WEBP form type
  3. VP8/VP8L/VP8X chunks

注意点

  • RIFFはWAVやAVIにも使われるため、8バイト目のWEBP確認が必要です。

判定コード例

SIGNATURE = bytes.fromhex("52494646")
OFFSET = 0

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

実践的な使い方

ユースケース

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

よくある判定ミス

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

セキュリティ上の注意

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

サンプルの活用

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

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Navy Blue Sky WebP preview

Navy Blue Sky WebP

Navy Blue Sky WebP is a WebP Image sample based on Wikimedia Commons, 3264 x 1627. It can be used to test downloads, parsers, previews, and file type detection.

navy-blue-sky.webp
Resolution 3264 x 1627 5.3 MP
High res
189 KB
SHA-256 b77e3e48632e90810e730ea69dfb3bf0e41b8b841df4d81d4a19e94f033c439d
Download
Sun Beauty WebP preview

Sun Beauty WebP

Sun Beauty WebP is a WebP Image sample based on Wikimedia Commons, 4160 x 3120. It can be used to test downloads, parsers, previews, and file type detection.

01-sun-beauty.webp
Resolution 4160 x 3120 13.0 MP
High res
286 KB
SHA-256 15c1a413b92c7b0d8df94d05651f9d05e08426b0cef0b57a7b50f9a20b3b715e
Download
Waterfalls Nature WebP preview

Waterfalls Nature WebP

Waterfalls Nature WebP is a WebP Image sample based on Wikimedia Commons, 1078 x 809. It can be used to test downloads, parsers, previews, and file type detection.

02-waterfalls-nature.webp
Resolution 1078 x 809 872 Kpx
Preview
251 KB
SHA-256 8f98d1e518205950da7777c006d933d67958118b4db901e3d764e5f280fb16d3
Download
Francis Landscape WebP preview

Francis Landscape WebP

Francis Landscape WebP is a WebP Image sample based on Wikimedia Commons, 1033 x 840. It can be used to test downloads, parsers, previews, and file type detection.

03-francis-landscape.webp
Resolution 1033 x 840 868 Kpx
Preview
123 KB
SHA-256 06d95912f8504355efdfe3091b6807442f46f8aed5cad1ea3a185d18e338024e
Download
Arcadian Landscape WebP preview

Arcadian Landscape WebP

Arcadian Landscape WebP is a WebP Image sample based on Wikimedia Commons, 1430 x 1084. It can be used to test downloads, parsers, previews, and file type detection.

04-arcadian-landscape.webp
Resolution 1430 x 1084 1.6 MP
PreviewLarge file
1.38 MB
SHA-256 43ee94c2b6c0b8573d5f060ad9d7ac095fc45fc8e98955d1972973f98f449de7
Download
Two Pointers Landscape WebP preview

Two Pointers Landscape WebP

Two Pointers Landscape WebP is a WebP Image sample based on Wikimedia Commons, 2880 x 2157. It can be used to test downloads, parsers, previews, and file type detection.

05-two-pointers-landscape.webp
Resolution 2880 x 2157 6.2 MP
High res
643 KB
SHA-256 52b1e2681fdad86f2a10e84dfd98bdda2ee5c5ca6efa7ea0a7be133cb10bd23e
Download
Mountainous Village WebP preview

Mountainous Village WebP

Mountainous Village WebP is a WebP Image sample based on Wikimedia Commons, 2880 x 2264. It can be used to test downloads, parsers, previews, and file type detection.

06-mountainous-village.webp
Resolution 2880 x 2264 6.5 MP
High resLarge file
1.38 MB
SHA-256 d309f333a4f2b285730cc4d238a81c52a78535c4fb5fe0438d737d2dd0673b09
Download
Carinthie Paysage WebP preview

Carinthie Paysage WebP

Carinthie Paysage WebP is a WebP Image sample based on Wikimedia Commons, 651 x 500. It can be used to test downloads, parsers, previews, and file type detection.

07-carinthie-paysage.webp
Resolution 651 x 500 326 Kpx
Preview
51 KB
SHA-256 581e9312d54e6936e7a53d516d1dd7ce33e6c82c965a14170eccaa62bd8e31c5
Download
Two Terriers Landscape WebP preview

Two Terriers Landscape WebP

Two Terriers Landscape WebP is a WebP Image sample based on Wikimedia Commons, 2880 x 2015. It can be used to test downloads, parsers, previews, and file type detection.

08-two-terriers-landscape.webp
Resolution 2880 x 2015 5.8 MP
High resLarge file
1.11 MB
SHA-256 e5a164b46320bbfc88d03bdfd8f95bfa905e8fd9d386bd2d1a58b03656f207b9
Download
Navy Blue Sky WebP preview

Navy Blue Sky WebP

Navy Blue Sky WebP is a WebP Image sample based on Wikimedia Commons, 3264 x 1627. It can be used to test downloads, parsers, previews, and file type detection.

09-navy-blue-sky.webp
Resolution 3264 x 1627 5.3 MP
High res
189 KB
SHA-256 b77e3e48632e90810e730ea69dfb3bf0e41b8b841df4d81d4a19e94f033c439d
Download
NASA Blue Marble WebP preview

NASA Blue Marble WebP

NASA Blue Marble WebP is a WebP Image 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.webp
Resolution 640 x 640 410 Kpx
Preview
47 KB
SHA-256 578940a934285ef5cfa736481932abce6ac1a44c334dbb9518be5f036e904042
Download

よくある質問

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

WebP Image ファイルはバイトシグネチャ 52 49 46 46 ("RIFF") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

WebP Image のMIMEタイプは?

WebP Image のMIMEタイプは image/webp です。

WebP Image の拡張子は?

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

関連フォーマット