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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-13-2012, 03:13 PM   #1
a.l.e
Junior Member
a.l.e began at the beginning.
 
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
a.l.e is offline   Reply With Quote
Old 09-13-2012, 06:13 PM   #2
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
Quote:
Originally Posted by a.l.e View Post
- 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)
the file 'minetype' has to have NO compression, and I think also has to be the first file in the zip/epub
Perkin is offline   Reply With Quote
Old 09-13-2012, 06:54 PM   #3
elmussol
Member
elmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura aboutelmussol has a spectacular aura about
 
Posts: 21
Karma: 4156
Join Date: Sep 2012
Location: Xerta, Catalunya [Spain]
Device: Kobo Reader Wifi
Ooh, interesting...
elmussol is offline   Reply With Quote
Old 09-14-2012, 02:16 AM   #4
a.l.e
Junior Member
a.l.e began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
Hi Perkin,

Quote:
Originally Posted by Perkin View Post
the file 'minetype' has to have NO compression, and I think also has to be the first file in the zip/epub
Thanks for your reply!

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
a.l.e is offline   Reply With Quote
Old 09-14-2012, 03:00 AM   #5
opitzs
Avid Reader
opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.opitzs can successfully navigate the Paris bus system.
 
opitzs's Avatar
 
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)
opitzs is offline   Reply With Quote
Old 09-14-2012, 05:17 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 2,867
Karma: 2714881
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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
Toxaris is offline   Reply With Quote
Old 09-14-2012, 05:35 AM   #7
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: 1,869
Karma: 4630362
Join Date: Dec 2010
Device: Kindle PW2
Also make sure that there's no line break character after "application/epub+zip".
Doitsu is offline   Reply With Quote
Old 09-14-2012, 05:42 AM   #8
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 644
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
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.
Perkin is offline   Reply With Quote
Old 09-14-2012, 10:59 AM   #9
st_albert
Fanatic
st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.st_albert calls his or her ebook reader Vera.
 
Posts: 544
Karma: 64420
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.
st_albert is offline   Reply With Quote
Old 09-15-2012, 04:11 AM   #10
a.l.e
Junior Member
a.l.e began at the beginning.
 
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
a.l.e is offline   Reply With Quote
Old 09-15-2012, 04:13 AM   #11
a.l.e
Junior Member
a.l.e began at the beginning.
 
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
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":

Code:
    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:
Code:
    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

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
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
a.l.e is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Exporting epub with InDesign: I lose blank lines! tibiafry ePub 19 12-15-2010 07:21 PM
Paragraph Style Not Exporting / ePub soulartist Workshop 5 12-11-2010 12:02 AM
Can Calibre Strip HTML links when exporting to epub? Dasun Calibre 4 11-10-2010 10:28 AM


All times are GMT -4. The time now is 10:06 PM.


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