Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-04-2015, 11:29 PM   #16
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
IIRC, the folder name should also not be there. On OS X, I just do:

Code:
cd extracted_book_directory
zip -Xr9D ../filename.epub mimetype * -x .DS_Store
Because the mimetype file is so small (in length), it is always more efficient to store it uncompressed, so in practice, no zip utility should ever compress it. You don't even need to worry about that; just make sure that it is the first file you pass to the zip utility.

BTW, if you want to squeeze an extra few percent from your delivery costs, I highly recommend installing advzip and doing:

Code:
advzip --recompress filename.epub
dgatwood is offline   Reply With Quote
Old 12-05-2015, 05:46 AM   #17
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,620
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by dgatwood View Post
IIRC, the folder name should also not be there. On OS X, I just do:
If you're referring to the commands I posted, the folder name was not in the commands.

If you're on OSX, I'm astonished that you're using the command line instead of the easy drag&drop applescript mentioned earlier.
pdurrant is offline   Reply With Quote
Old 12-05-2015, 04:32 PM   #18
crankypants
Hmm.
crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.crankypants ought to be getting tired of karma fortunes by now.
 
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
Shortly after I posted my last post in this thread, my programs stopped running from the flash drive I develop on. The flash drive is only a year old. I tried installing Strawberry Perl and my other tools on 2 more flash drives with the same error: the program just locks up if run from the flash drive.

I'm currently installing all my tools to my c: drive, which seems to work, and leaving my project files on the flash drive.
crankypants is offline   Reply With Quote
Old 12-05-2015, 07:27 PM   #19
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by dgatwood View Post
IIRC, the folder name should also not be there. On OS X, I just do:

Code:
cd extracted_book_directory
zip -Xr9D ../filename.epub mimetype * -x .DS_Store
Well, I assume that is why pdurrant's post explicitly referenced a mimetype file in currentdir.

Quote:
Because the mimetype file is so small (in length), it is always more efficient to store it uncompressed, so in practice, no zip utility should ever compress it. You don't even need to worry about that; just make sure that it is the first file you pass to the zip utility.
Is it worth the risk?

In order to get away with using one command, instead of two, in a shell script, I don't see why you should be making that assumption.

Last edited by eschwartz; 12-05-2015 at 07:54 PM. Reason: fixed quote
eschwartz is offline   Reply With Quote
Old 12-05-2015, 09:06 PM   #20
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by pdurrant View Post
If you're referring to the commands I posted, the folder name was not in the commands.
No, I was just speaking generally.
dgatwood is offline   Reply With Quote
Old 12-05-2015, 09:23 PM   #21
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by eschwartz View Post
Is it worth the risk?
It is pretty much guaranteed. The string "application/epub+zip" is only 20 bytes long. Using the DEFLATE algorithm more than doubles its length to 42 bytes. No zip tool worth its weight in manure is going to choose to use the DEFLATE output if doing so would more than double the length of the file.
dgatwood is offline   Reply With Quote
Old 12-05-2015, 10:21 PM   #22
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by dgatwood View Post
It is pretty much guaranteed. The string "application/epub+zip" is only 20 bytes long. Using the DEFLATE algorithm more than doubles its length to 42 bytes. No zip tool worth its weight in manure is going to choose to use the DEFLATE output if doing so would more than double the length of the file.
Understood...
But even a zip tool that isn't worth its weight in manure but is technically creating a perfectly valid ZIP, might exist.

Since I would anyway suggest scripting the EPUB zipping (much less typing of exclusions plus various magical incantations, and you can pass a directory + auto-name the EPUB), there is no loss in adding an extra line, and it doesn't really take longer to zip... so why rely on "should"s? It is just generally a bad idea to rely on undocumented assumed (rightly so) behavior, but especially when there is literally no downside to being extra careful!
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating Epub Thom* Editor 6 07-08-2015 04:17 AM
validating epub fails - how do I correct? BeccaPrice ePub 14 06-12-2013 02:01 PM
Validating epub returns warning writerkit Conversion 2 03-30-2013 02:35 AM
Issues validating EPUB for iPad godsmac Calibre 13 06-26-2011 09:02 PM


All times are GMT -4. The time now is 10:49 AM.


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