Rainie3535 / sigil

Automatically exported from code.google.com/p/sigil
GNU General Public License v3.0
0 stars 0 forks source link

Sigil has encountered a problem #1210

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please read http://code.google.com/p/sigil/wiki/ReportingIssues for
information about submitting a good bug report.

What steps will reproduce the problem?
1.opening this book from the calibre library
2.
3.
...

What is the expected output? What do you see instead?
I expect to open the book but I get an error message 

What version of the product are you using? On what operating system?
0.4.2

Please provide any additional information below. If your source file
(SGF/EPUB/HTML/etc) is required to fully understand the problem, please
attach it to this issue. Read the ReportingIssues wiki page before
submitting!

Original issue reported on code.google.com by rremel...@gmail.com on 28 Jan 2012 at 11:27

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by john@nachtimwald.com on 29 Jan 2012 at 12:10

GoogleCodeExporter commented 9 years ago
I don't think this is a duplicate of 1019, or at least the current source build 
post 0.5.0 still has an issue with this file.

The problem is that the file contains lines with opf: defined and the error is 
that opf namespace is used but not declared.

I don't know what software produced this file, or why the opf namespace isn't 
declared (or even what that is), or why the lines have opf: in them, but one 
possible hack fix at the end of ImportOEBPS::PrepareOPFForReading is

    // MASSIVE hack for allowing parsing of files with opf: namespace used but not declared
    source_copy.replace( QRegExp( "<([/])*opf:") , "<\\1" );

Now, whether this is appropriate or what implications it has is hard to say 
(e.g. what if the opf namespace is declared?  should it be adding a declaration 
instead of removing the entries?), but given the other hacks rewriting the 
contents file something like this doesn't seem out of line.

For the submitter, the way to work around this is to unzip the file.  Change 
the permissions of all the files to be readable (for some reason they are all 
set to unreadable).  Edit the contents.opf file and remove opf: wherever you 
see <opf: or </opf:   Then zip up the file again to a new test.epub file.

Original comment by meme90...@gmail.com on 29 Jan 2012 at 11:03

GoogleCodeExporter commented 9 years ago
Changing to lack info as no EPUB demonstrating the issue was attached. Attach a 
sample file so the issue can be confirmed.

Original comment by john@nachtimwald.com on 29 Jan 2012 at 2:08

GoogleCodeExporter commented 9 years ago
I've removed the opf namespace rewriting because #1212 also had an issue with 
it. Most likely this issue is the same issue but without a sample file I cannot 
be sure.

Original comment by john@nachtimwald.com on 29 Jan 2012 at 2:19

GoogleCodeExporter commented 9 years ago
My comments above were actually meant for 1212 - not sure how they ended up on 
this one...

Original comment by meme90...@gmail.com on 29 Jan 2012 at 6:32

GoogleCodeExporter commented 9 years ago
Looking at the version number supplied for this ticket it is a duplicate of 
1019.

Original comment by john@nachtimwald.com on 29 Jan 2012 at 7:23