aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2024-03-11 14:01:40 -0700
committerJames Zern <jzern@google.com>2024-03-11 14:01:40 -0700
commita16d30cb578cedd3b3a2d75bf041f99310fdef63 (patch)
treeb4ca03f3915e05adbd075ad7a45ac0ea5a0261a7
parent8a7e911231152b6782109bec48c02f25c2382798 (diff)
downloadwebp-a16d30cb578cedd3b3a2d75bf041f99310fdef63.tar.gz
webp-container-spec: clarify chunk order requirements
based on comments from: https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_robert-wilton Change-Id: If2cd956b607c51b714e82e8eee7a1c4375c3c632
-rw-r--r--doc/webp-container-spec.txt21
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/webp-container-spec.txt b/doc/webp-container-spec.txt
index 1cd3da78..c6f83fef 100644
--- a/doc/webp-container-spec.txt
+++ b/doc/webp-container-spec.txt
@@ -290,15 +290,18 @@ up of:
For an _animated image_, the _image data_ consists of multiple frames. More
details about frames can be found in the [Animation](#animation) section.
-All chunks SHOULD be placed in the same order as listed above. If a chunk
-appears in the wrong place, the file is invalid, but readers MAY parse the
-file, ignoring the chunks that are out of order.
-
-**Rationale:** Setting the order of chunks should allow quicker file
-parsing. For example, if an 'ALPH' Chunk does not appear in its required
-position, a decoder can choose to stop searching for it. The rule of
-ignoring late chunks should make programs that need to do a full search
-give the same results as the ones stopping early.
+All chunks necessary for reconstruction and color correction, that is 'VP8X',
+'ICCP', 'ANIM', 'ANMF', 'ALPH', 'VP8' and 'VP8L', MUST appear in the order
+described above. Readers SHOULD fail when chunks necessary for reconstruction
+and color correction are out of order.
+
+[Metadata](#metadata) and [unknown](#unknown-chunks) chunks MAY appear out of
+order.
+
+**Rationale:** The chunks necessary for reconstruction should appear first in
+the file to allow a reader to begin decoding an image before receiving all of
+the data. An application may benefit from varying the order of metadata and
+custom chunks to suit the implementation.
Extended WebP file header:
{:#extended_header}