View Full Version : How to rezip an epub file?


meadowlarkOR
12-04-2011, 01:02 PM
Hello all,

I'm new to the forum, just starting to learn to create epub files. I'm on a PC. I've been able to get at the files inside the epub. I changed the .epub extension to .zip and then right-clicked and chose Extract All. Everything was there and editable.

However, when I reverse the process, my epub file won't open and I get an error message that's way above my pay grade. I chose the folder all the files were in and gave it a .zip extension. Then I changed that extension to .epub. No dice!

Can anyone tell me what I'm doing wrong (or another resource I might try?)?

Thanks!

mtrahan
12-04-2011, 01:07 PM
You need to zip the files in a specific way. Give ePubPack a try very simple, and does exactly what you need.

http://sourceforge.net/projects/epubpack/

Btw, to do it by hand, here's what you need to do:


Create an empty .zip file with whatever name you like (See notes below for detailed instructions on how to do this.)
Copy the mimetype file into the zip file (don't use compression on this file)
Copy the rest of the files and folders mentioned above into the zip file *
Re-name the .zip extension to .epub


* The specification recommends that the books files go in an "OEBPS" folder inside the zip file. If you put them in another spot, be sure that container.xml in the META-INF folder points to the correct location of the *.opf file.

Info from: http://www.jedisaber.com/eBooks/Tutorial03.shtml

wallcraft
12-04-2011, 03:10 PM
Another way to do this is to import the epub into Calibre and use its "Tweak ePub" option. Right click on a title with an ePub and select "Tweak ePub" then "explode epub", edit any contained files and then "rebuild".

JSWolf
12-04-2011, 06:47 PM
When you extract the files from the ePub,m do not extract META-INF and metadata. Leave those alone. Then when you put back the rest of the files, the ePub will be compressed correctly (if it was correct before you extracted any of the contents).

dwig
12-05-2011, 10:37 AM
...I'm on a PC. I've been able to get at the files inside the epub. I changed the .epub extension to .zip and then right-clicked and chose Extract All. Everything was there and editable....

I avoid re-zipping the ePub. I simply view the files in the ZIP version and manually drag out copies of the file(s) that needs editing. I make my fixes and then drag the fixed version back into the ZIP archive replacing the original.

ghostyjack
12-06-2011, 09:49 AM
I avoid re-zipping the ePub. I simply view the files in the ZIP version and manually drag out copies of the file(s) that needs editing. I make my fixes and then drag the fixed version back into the ZIP archive replacing the original.

That's the approach I use.

Using the "open with" option using winzip, dragging the file out and then back in after modification works a treat. Not had a problem with this from the hundreds I've modified.

Only need to do this though until Sigil retains the original epub structure, and then you can open it in Sigil instead.

dwig
12-06-2011, 10:35 AM
...

Only need to do this though until Sigil retains the original epub structure, and then you can open it in Sigil instead...

There will still be need of this type of manipulation unless Sigil gets real sophisticated and adds the ability to have bitmaps be opened in an external app for editing. I find that adjusting images in Photoshop to be my most common use for this.

st_albert
12-06-2011, 11:55 AM
Since you're on Windows, the makers of the Atlantis Word Processor have published a free stand-alone program called "tweak_epub.exe" which will let you open, edit, and repack the epub. (I don't remember where to find it, but Google is your friend.)

victorhugoa
12-07-2011, 08:29 AM
Oxygen allows you to work inside any epub file without decompressing changing names or anything like that. Simple and direct tool that opens the files inside, keeps the structure and there is no necessity to compress again.

73ChargerFan
01-13-2012, 02:02 PM
Calibre works just fine with unzipped/rezipped epub files using 7zip.

I'll try the other tools mentioned in this thread also.