Skip to content

Make/correct EPUB 3 OCF ZIP Container using libzip

Notifications You must be signed in to change notification settings

gromnitsky/epub-zip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$ wc -l *.c
  91 epub-zip.c
  59 epub-zip-mimetype-fix.c
 150 total

Set EPUB_ZIP_DEBUG=1 env var for verbose mode.

epub-zip

Makes a proper EPUB 3 OCF ZIP Container:

  • automatically adds mimetype file entry as a 1st file without compression & extra fields;
  • doesn't compress already compressed files like jpegs;
  • won't allow adding non-supported file types like symlinks.

Usage:

$ epub-zip out.epub `find src`

epub-zip-mimetype-fix

Corrects a botched EPUB 3 OCF ZIP Container in-place:

  • moves mimetype file to the 1st position in an archive;
  • removes compression & extra fileds from mimetype file.

Usage:

$ epub-zip-mimetype-fix file.epub

Compilation

$ sudo dnf install libzip-devel     # tested with 1.9.2
$ make

License

MIT.

About

Make/correct EPUB 3 OCF ZIP Container using libzip

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published