12

This error can occur when the mimetype is compressed inside the epub zip file. What can be done is to create a zip file with only the mimetype file inside but with no compression. You can do that with 7-Zip setting the Compression level to Store. In Linux, you can also do that with the terminal command: zip -0 file.epub mimetype Then drag and drop the ...


6

I am not sure what your two .opf files contain, but the EPUB 2.0.1 specs http://www.idpf.org/doc_library/epub/OCF_2.0.1_draft.doc (section 10.1) say: The <rootfiles> element MUST contain at least one element that has a media-type of “application/oebps-package+xml”. Only one element with a media-type of “application/oebps-package+xml” SHOULD ...


5

I use a GUI version, that conforms to the standard. It checks all the same places, and the references. All you would need to do is open the file and drag and drop the EPUB file, you can even verify multiple EPUBs by folder. The download page at pagina has an English description below the German. Downloads available for Windows, OSX and Linux.


5

First go to https://github.com/IDPF/epubcheck/releases and download the last version of EpubCheck as zip file. Unzip the folder. Be sure that you have Java Runtime (1.5 or above) installed, if not go to http://www.java.com to donwload. Check if the Path variable is set to the folder where java.exe was installed. If not, go to Control Panel -> System -> ...


2

I've too developed a GUI for epubcheck. It's licensed under the GNU AGPLv3 or any later version, written in Java, translated into English and German so far, and it is capable of searching directories recursively for EPUBs. See a demo video and the source code. There's also a precompiled download package available.


2

zip -X0 ../myEPUB.epub mimetype zip -9 -r ../myEPUB.epub META-INF OEBPS another common error i was getting was extra characters in mimetype 'Mimetype file should only contain the string 'application/epub+zip' and should not be compressed' I found that my editor Geany was adding a newline when I saved the file and this caused an epubcheck error - a tweak in ...


2

Unfortunately, there's a lot more wrong than the errors listed. The first line needs to be (adding the question mark): <?xml version="1.0" encoding="utf-8" standalone="no"?> After you correct that and validate that, you will turn up 100s of validation messages -- not only in the opf file but also the xhtml files. This tells me that your method for ...


1

This happens because at least two parts of EPUBCheck dislike the ISO8601 timezone format in different ways. In the dc:date context, EPUBCheck is OK with "2020-12-09T14:06:40-07:00" but not with "2020-12-09T14:06:40-0700". The only difference is a colon in the timezone offset of 0700 hours. I learned about this oddity from a PHP manual ...


1

If you are not going to use a ncx, my answer is no, you don't need to change this xhtml file at all. I'm going to guess here. ns:ncx means that you are using a namespace called "ncx." A namespace is like an xml prefix. Somewhere -- maybe on another file -- you are referring to the ncx namespace, and the error is suggesting that you need to identify it ...


1

I posted an issue at the epubcheck site. Someone there knew right away what the problem was. This is acceptable: <p>Text <span class="red">red</span> regular.</p> This is acceptable: <p>Text <span style="color:red">red</span> regular.</p> This is not acceptable, and is what I had: <p>Text <span ...


1

I'm responsible for an attempt to improve this error message, see https://github.com/IDPF/epubcheck/pull/497 for details. Essentially your Zip packer puts some application or operating system specific stuff into the file, which breaks EPUB mimetype magic number support.


1

As the accepted answer states, the mimetype file should be stored uncompressed in the archive. For those looking for a programmatic way to validate and package an EPUB I recommend using the Java EPUBCheck tool by W3C. You can use it as a command line tool and as a Java library. The tool allows you to validate an expanded EPUB folder and save it as an EPUB ...


1

Here are the steps I used to force the "mimetype" file to be the first in the EPUB archive using 7-Zip in Windows: Make a copy of your EPUB (zip) file (e.g. MyBookCopy.epub), so to not damage your original EPUB file in case things go wrong. Extract all of the files from MyBookCopy.epub into an empty folder (e.g. MyFolder) Using the 7-zip UI, ...


1

7-zip sorts files by names rename mimetype to ##mimetype Add to archive... ##mimetype Archive: book.zip Archive format: zip Compression level: Store OK Add to archive... the other folders META_INF EPUB Archive: book.zip Archive format: zip Compression level: Normal OK Open archive... book.zip rename: ##mimetype to mimetype OK rename book.zip to book.epub


Only top voted, non community-wiki answers of a minimum length are eligible