On dinsdag 8 september 2020 14:27:55 CEST Christian Grün wrote:
Hi Jos,
There are 5 bytes between 'mimetype' and 'applicatino/epub+zip'. These are deflate information. If the entry is 'stored' there are no bytes between the entry name […]
Great, so we are talking about the same thing.
I think the simplest solution is to save compression-level=0 as stored.
That was also my thought. A quick fix caused the following error message (similar to what is described here [1])…
Operation failed: STORED entry missing size, compressed size, or crc-32.
…which means we’ll probably need to set additional values before writing the actual byte array. I’ll see what we can do.
I was surprised to learn more about the deficiencies of the Archive Module. The module was already used many times in the past to create ePub files, so my guess would be that these files could be opened by many readers, but were not 100% valid. How do you usually proceed to check the validity of ePub files?
I think many, but not all, tools are forgiving. Especially tools that scan many files such as file explorers, will rely on 'magic bytes'. Most epub files comply to having a 'stored' mimetype as the first file. From a local collection from various sources 138 out of 159 files comply.
For ODF, complyance to this rule is almost universal. EPub actually adopted the practice of a stored mimetype from ODF.
For validation of epub files you can use the w3c validator. https://github.com/w3c/epubcheck For ODF you can use the ODF validator: https://odftoolkit.org/conformance/ODFValidator.html
Best regards, Jos