09-13-2012, 03:13 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
|
Exporting to epub from Scribus
Hi people,
during the last few months I've been working -- among other things -- on a plugin which will export the content of a Scribus file to the epub format. The epub generated should be of high quality, but the goal is not to transform Scribus in an epub editor. For now there will be very few option in the export dialog and nothing will be changed in Scribus to design the way the content will be exported to epub. The epub generated should be usable as is, but for the one who want more control will have to work on their epub file in an editor like Sigil. In my work, I've been using Sigil as a reference and I'd like to make sure that the file Scribus will be creating are perfectly compatible with what Sigil expects to find. I have two questions to the Sigil community: - can anybody test the plugin and give feedback on the epub created? (the plugin is in the "epub" branch of our git repository: git://git.scribus.net/scribus.git ; i should be able to create a PPA very soon) - can any of the developer help me to find out why epubcheck gives the error: ERROR: /tmp/text_simple.epub: Mimetype contains wrong type (application/epub+zip expected) (i'm using the same zip library as sigil has i've found in Sigil, but in an older version) I whish you a wonderful evening a.l.e |
09-13-2012, 06:13 PM | #2 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
the file 'minetype' has to have NO compression, and I think also has to be the first file in the zip/epub
|
Advert | |
|
09-13-2012, 06:54 PM | #3 |
Member
Posts: 21
Karma: 4156
Join Date: Sep 2012
Location: Xerta, Catalunya [Spain]
Device: Kobo Reader Wifi
|
Ooh, interesting...
|
09-14-2012, 02:16 AM | #4 | |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
|
Hi Perkin,
Quote:
this is the beginning of one of the epub i generate: PK^C^D^T^@^@^@^H^@^@^@^@^@oa«,^Y^@^@^@^T^@^@^@^H^@ ^@^@mimetype^A^T^@ëÿapplication/epub+zipPK^C^D^T^@^@^@^H^@^@^@^@^@JÕ^Ujý^@^@^@ø^@^ @^@^V^@^@^@META-INF/container.xml^Aø^@^Gÿ<?xml version="1.0" encoding="utf-8"?> <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:conta iner"> <rootfiles> <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/> </rootfiles> </container> (i hope it got through...) the mimetype seems to be uncompressed and at the beginning of the file... does anybody see something strange? ciao a.l.e Last edited by Jellby; 09-14-2012 at 04:51 AM. Reason: removed smilies in code |
|
09-14-2012, 03:00 AM | #5 |
Avid Reader
Posts: 161
Karma: 36472
Join Date: Sep 2008
Location: Look for rain, hail and snow...
Device: PRS-505, PRS-600, PRS T1, Kobo Glo
|
I just opened a book and it looks like this:
PK ! oa«, mimetypeapplication/epub+zipPK Ó%A@iâ I wonder if the missing "^A^T^@ëÿ" between mimetype and application could have something to do with it... (In my example there is nothing between those two, I checked in hex view) |
Advert | |
|
09-14-2012, 05:17 AM | #6 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
I think the message is actually about the mimetype file. The mimetype file is a text file and content of the mimetype file must be:
Code:
application/epub+zip |
09-14-2012, 05:35 AM | #7 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Also make sure that there's no line break character after "application/epub+zip".
|
09-14-2012, 05:42 AM | #8 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Yes, Toxaris has what I meant.
Sorry, English IS my first language so I apologise if I'm not understandable. In the root folder of any epub file, there is a file named 'mimetype' (with no extension), this is the file I meant as having to first file (added) in the epub (zip), and have NO compression. It's contents is as Toxaris noted. |
09-14-2012, 10:59 AM | #9 |
Guru
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
|
note also that the "mimetype" file must be exactly 20 bytes in size (compressed and uncompressed). if it isn't, something is wrong.
Example: Code:
$ unzip -v elBrujo.epub Archive: elBrujo.epub Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 20 Stored 20 0% 2011-11-11 17:12 2cab616f mimetype 259 Defl:S 180 31% 2011-11-11 17:12 9aa7f027 META-INF/container.xml 7122 Defl:S 1612 77% 2011-11-11 17:12 2079d1c6 OEBPS/content.opf 5742 Defl:S 1070 81% 2011-11-11 17:12 f6ff143a OEBPS/toc.ncx ... etc. |
09-15-2012, 04:11 AM | #10 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
|
indeed unzip -v gives:
$ unzip -v text_simple.epub Archive: text_simple.epub Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 20 Defl:N 25 -25% 1980-00-00 00:00 2cab616f mimetype which shows a size of 25 instead of 20 and a method as Defl:N instead of stored... i've checked my call to zipOpenNewFileInZip -- which for simplicity was not supposed to ever compress a file -- and could figure out why in my example it says "Defl": if (zipOpenNewFileInZip(file, filename.toUtf8().constData(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_NO_COMPRESSION) != Z_OK) changed to a/ use the compression flag and b/ not use Z_DEFLATED when no compression is selected: if (zipOpenNewFileInZip(file, filename.toUtf8().constData(), NULL, NULL, 0, NULL, 0, NULL, (compression ? Z_DEFLATED : 0), (compression ? 8 : Z_NO_COMPRESSION)) != Z_OK) the warning wen away and $ unzip -v text_simple.epub Archive: text_simple.epub Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 20 Stored 20 0% 1980-00-00 00:00 2cab616f mimetype thanks for your help! your hints lead me to check the right thing! i will commit the change before tomorrow if somebody wants to give a try... ciao a.l.e |
09-15-2012, 04:13 AM | #11 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
|
indeed unzip -v gives:
Code:
$ unzip -v text_simple.epub Archive: text_simple.epub Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 20 Defl:N 25 -25% 1980-00-00 00:00 2cab616f mimetype i've checked my call to zipOpenNewFileInZip -- which for simplicity was not supposed to ever compress a file -- and could figure out why in my example it says "Defl": Code:
if (zipOpenNewFileInZip(file, filename.toUtf8().constData(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_NO_COMPRESSION) != Z_OK) Code:
if (zipOpenNewFileInZip(file, filename.toUtf8().constData(), NULL, NULL, 0, NULL, 0, NULL, (compression ? Z_DEFLATED : 0), (compression ? 8 : Z_NO_COMPRESSION)) != Z_OK) Code:
$ unzip -v text_simple.epub Archive: text_simple.epub Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 20 Stored 20 0% 1980-00-00 00:00 2cab616f mimetype i will commit the change before tomorrow if somebody wants to give a try... ciao a.l.e |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Exporting epub with InDesign: I lose blank lines! | tibiafry | ePub | 67 | 11-13-2023 08:57 AM |
Can Calibre Strip HTML links when exporting to epub? | Dasun | Calibre | 6 | 03-03-2020 02:47 AM |
Non-alpha characters not exporting properly to ePub from InDesign | forlor | ePub | 9 | 07-12-2013 02:02 AM |
Is there a way...exporting | mrkinsopo | Library Management | 1 | 07-04-2012 06:48 PM |
Paragraph Style Not Exporting / ePub | soulartist | Workshop | 5 | 12-11-2010 12:02 AM |