Difference between revisions of "ZIM file format"

Jump to navigation Jump to search
(11 intermediate revisions by the same user not shown)
Line 12: Line 12:
| magicNumber || integer || 0 || 4 || Magic number to recognise the file format, must be 72173914 (0x44D495A)
| magicNumber || integer || 0 || 4 || Magic number to recognise the file format, must be 72173914 (0x44D495A)
|-
|-
|majorVersion
| [[#Major_.26_Minor_versions|majorVersion]]
|integer
| integer
|4
| 4
|2
| 2
|Major version of the ZIM archive format (6)
| Major version of the ZIM archive format. Major version is updated when an incompatible change is integrated in the format (a lib made for a version N will probably not be able to read a version N+1)
|-
|-
| minorVersion || integer || 6 || 2 || Minor version of the ZIM archive format (1 for new namespace usage, 0 for old namespace usage)                      
| [[#Major_.26_Minor_versions|minorVersion]] || integer || 6 || 2 || Minor version of the ZIM archive format. Minor version is updated when an compatible change is integrated (a lib made for a minor version n will be able to read a version n+1)                      
|-
|-
| uuid || integer || 8 || 16 || unique id of this zim archive                           
| uuid || integer || 8 || 16 || unique id of this zim archive                           
Line 42: Line 42:
|}
|}


Major version is updated when an incompatible change is integrated in the format (a lib made for a version N will probably not be able to read a version N+1)
A ZIM archive may be embedded in another file at a specific offset. In the context of the ZIM format, the start of the ZIM header is the offset 0. Readers allowing to read an embedded archive must adapt offset accordingly.


Minor version is updated when an compatible change is integrated (a lib made for a minor version n will be able to read a version n+1)
=== Major & Minor versions ===


The current major version is 6. You may found old zim archives with major version 5. They are the same than 6 less extended cluster, so you can read a 5 major version as if it was a 6.
Versioning of the file format specification has not been done [https://semver.org/ rigorously] until version 6.


The minor version can be :
{| class="wikitable"
* 0 : We use the old namespace usage (see [[ZIM file format old namespace]])
|+ ZIM format versions
* 1 : We use the new namespace usage (describe here).
|-
* 2 : Means that libzim (reference implementation) allow to create alias entries (Several entries pointing to the same cluster/blob). This was already allowed by specification, this is hint only.
! Major !! Minor !! Backward compatible !! Description
 
|-
A zim archive may be embedded in another file at a specific offset. In the context of zim format, the start of the zim header is the offset 0. Readers allowing to read an embedded archive must adapt offset accordingly.
| 0 || 0 || no || ''This version features have not been tracked properly''
|-
| 1 || 0 || no || ''This version features have not been tracked properly''
|-
| 2 || 0 || no || ''This version features have not been tracked properly''
|-
| 3 || 0 || no || ''This version features have not been tracked properly''
|-
| 4 || 0 || yes || Introduces title index
|-
| 5 || 0 || yes || Introduces extended clusters
|-
| rowspan="3" | 6 || 0 || no  || Still uses [[ZIM file format old namespace|"old" namespaces]]
|-
|                    1 || no  || Introduces [[#Namespaces|"new" namespaces]]
|-
|                    2 || yes || Explicitly allows alias entries (several entries pointing to the same cluster/blob)
|}


== MIME Type List (mimeListPos) ==
== MIME Type List (mimeListPos) ==

Navigation menu