Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-28-2020, 10:28 AM   #1
PenguinCEO
Member Retired
PenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipedia
 
Posts: 61
Karma: 47166
Join Date: Sep 2018
Device: a lot
故事主要描述當伐木

故事主要描述當伐木

Last edited by PenguinCEO; 05-03-2020 at 04:43 PM.
PenguinCEO is offline   Reply With Quote
Old 03-28-2020, 12:55 PM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,914
Karma: 16234093
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by PenguinCEO View Post
I would like to compare that code with a possible "standard". Where can I find a document that describes the standard of internal structure and file compression levels within an epub?
It's in the EPUB Open Container Format specification.
Doitsu is offline   Reply With Quote
Old 03-31-2020, 03:53 PM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,185
Karma: 10999743
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
My base script:

Code:
zip -X0 "${FILENAME}.epub" mimetype
zip -X9Dr "${FILENAME}.epub" META-INF OEBPS
advzip -z -4 "${FILENAME}.epub"
Jellby is offline   Reply With Quote
Old 04-01-2020, 01:27 PM   #4
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 4,269
Karma: 2621140
Join Date: Nov 2009
Device: many
FWIW, epub3 spec does not require an OEBPS folder or even any folder at all.
KevinH is offline   Reply With Quote
Old 04-01-2020, 05:20 PM   #5
PenguinCEO
Member Retired
PenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipedia
 
Posts: 61
Karma: 47166
Join Date: Sep 2018
Device: a lot
故事主要描述當伐木

Last edited by PenguinCEO; 05-03-2020 at 04:43 PM.
PenguinCEO is offline   Reply With Quote
Old 04-02-2020, 12:31 AM   #6
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 7,502
Karma: 33333333
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by Jellby View Post
My base script:

Code:
zip -X0 "${FILENAME}.epub" mimetype
zip -X9Dr "${FILENAME}.epub" META-INF OEBPS
advzip -z -4 "${FILENAME}.epub"
Given that the mimetype file is not to be compressed, why are you using the advzip with "insane" to compress the epub file? The only option for the mimetype would be 0 to store without compression.

To quote the epub 3.2 OCF ZIP Container specification:

4.3 OCF ZIP Container Media Type Identification

The first file in the OCF ZIP Container MUST be the mimetype file, which meets the following requirements:

The contents of the mimetype file MUST be the MIME media type [RFC2046] string application/epub+zip encoded in US-ASCII [US-ASCII].
The mimetype file MUST NOT contain any leading or trailing padding or white space.
The mimetype file MUST NOT begin with the Unicode byte order mark U+FEFF.
The mimetype file MUST NOT be compressed or encrypted, and there MUST NOT be an extra field in its ZIP header.
DNSB is offline   Reply With Quote
Old 04-02-2020, 06:56 AM   #7
najgori
Klak
najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.
 
najgori's Avatar
 
Posts: 141
Karma: 148812
Join Date: Sep 2011
Location: Belgrade, Serbia
Device: many
i think that advzip does not recompress stored files and mimetype is stored.
for someone advzip could be finishing "touch" to epub before sending it to client or wahtever....
najgori is offline   Reply With Quote
Old 04-02-2020, 09:47 AM   #8
PenguinCEO
Member Retired
PenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipedia
 
Posts: 61
Karma: 47166
Join Date: Sep 2018
Device: a lot
故事主要描述當伐木

Last edited by PenguinCEO; 05-04-2020 at 05:28 AM.
PenguinCEO is offline   Reply With Quote
Old 04-02-2020, 10:28 AM   #9
najgori
Klak
najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.najgori is considered a powerful good luck charm in most of the civilised world.
 
najgori's Avatar
 
Posts: 141
Karma: 148812
Join Date: Sep 2011
Location: Belgrade, Serbia
Device: many
I tend not to read documentation. Have you tested it?
najgori is offline   Reply With Quote
Old 04-02-2020, 10:43 AM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,185
Karma: 10999743
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I think I probably missed the fact that advzip could be messing with the mimetype file. So far, I haven't had any problems, either in an actual reader (Kobo) or in calibre (including the "check book" option in the editor), so it could be that advzip is actually not touching the mimetype.

Anyway, the file is so small that even adding it with -X9 results in it being stored without compression.

Last edited by Jellby; 04-02-2020 at 10:51 AM.
Jellby is offline   Reply With Quote
Old 04-02-2020, 11:14 AM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 7,502
Karma: 33333333
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by Jellby View Post
I think I probably missed the fact that advzip could be messing with the mimetype file. So far, I haven't had any problems, either in an actual reader (Kobo) or in calibre (including the "check book" option in the editor), so it could be that advzip is actually not touching the mimetype.

Anyway, the file is so small that even adding it with -X9 results in it being stored without compression.
From what I saw in the advzip documentation, 1-4 will check the file and store as uncompressed, with original compression or re-compressed depending on which gives the smaller file size. I suspect the mimetype file is so small that it will not be compressed but you are rolling the dice. Asides, I am not a fan of zopfli -- it is so damned slow.
DNSB is offline   Reply With Quote
Old 04-02-2020, 12:39 PM   #12
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,185
Karma: 10999743
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
but you are rolling the dice.
Yes, I guess you are right. I could always check that the mimetype file remains uncompressed (with e.g. advzip -l).

Quote:
Asides, I am not a fan of zopfli -- it is so damned slow.
Well, it's not something I have to run thousands of times a day, just once when the ebook is ready. I usually get a reduction to ~98% filesize, so I could also do without it.
Jellby is offline   Reply With Quote
Old 04-06-2020, 07:12 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 57,140
Karma: 52070132
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by PenguinCEO View Post
I am writing a bash script to build an epub from a file folder. The focus of the script are the following lines of code:

Code:
zip -X0 ${FILENAME}.epub mimetype
zip -Xr9 ${FILENAME}.epub META-INF/
zip -Xr9 ${FILENAME}.epub oebps/
I would like to compare that code with a possible "standard". Where can I find a document that describes the standard of internal structure and file compression levels within an epub?
You can use ePubPack (Windows) to create your ePub from files. Here's the link to the MR thread.

https://www.mobileread.com/forums/sh...ad.php?t=84675
JSWolf is offline   Reply With Quote
Old 04-06-2020, 12:24 PM   #14
PenguinCEO
Member Retired
PenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipediaPenguinCEO knows more than wikipedia
 
Posts: 61
Karma: 47166
Join Date: Sep 2018
Device: a lot
故事主要描述當伐木

Last edited by PenguinCEO; 05-04-2020 at 05:29 AM.
PenguinCEO is offline   Reply With Quote
Old 04-06-2020, 12:26 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 57,140
Karma: 52070132
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by PenguinCEO View Post
I don't use windows. The thread has a standard, not a program, as its argument. In any case: have you read the ePubPack code? Can you guarantee that it fully complies with the standard?
I used to use it. So I know it's fully standards compatible. If it wasn't, someone would have pointed that out in the thread about it.

And as I've said for a long time and will continue to say, Windows is the best OS for eBooks.
JSWolf is offline   Reply With Quote
Reply

Tags
bash, epub, standards, zip

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Zipping subfolders Tanjamuse Lounge 1 09-01-2019 10:37 AM
Question about metadata in epub files vs opf files machstem Calibre 3 06-19-2017 12:43 PM
epub files on kobo have all been changed into shortcut files? emme278 Kobo Reader 6 11-01-2013 04:32 AM
RE: Zipping/Mimetype/? Hitch Sigil 31 08-02-2013 05:15 PM
Txt files - Convert to Epub - Multiple files into one book - noob help Cernan Calibre 6 05-18-2010 10:12 AM


All times are GMT -4. The time now is 11:07 PM.


MobileRead.com is a privately owned, operated and funded community.