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 02-12-2018, 06:54 PM   #1
ChrisI
Enthusiast
ChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-books
 
Posts: 36
Karma: 847
Join Date: Sep 2007
Device: Sony PRS500
Unable to Insert or Split Pages

I am working with an epub 2 document, and if I attempt to split any page at cursor, or even just insert a new blank page, Sigil crashes.

I was using 0.9.7, and upgraded to 0.9.9. No change.

I can do this successfully with other documents, but not this one, so I suspect there is a problem with the file.

However, Flight Crew says the epub is valid. Any ideas as to what else I can look for?
ChrisI is offline   Reply With Quote
Advert
Old 02-12-2018, 07:13 PM   #2
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,830
Karma: 1328806
Join Date: Nov 2009
Device: many
What platform? Any message that comes with the crash? Sigil 0.9.9 actually has a bug fix to prevent just this bug that was fixed in 0.9.8 so stick with 0.9.9. Some new Windows boxes have the tmp directory default to be automatically emptied and this can cause lots of crashes as Sigil makes heavy use of tmp files.

If it is legal to post the problem epub2, please post it so that authors can try to recreate the issue.
KevinH is online now   Reply With Quote
Old 02-12-2018, 07:17 PM   #3
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,830
Karma: 1328806
Join Date: Nov 2009
Device: many
Also after upgrading to the newest version please use the Sigil About menu to verify the exact version being run.

Another thing to try is saving and renaming your sigil.ini file and let it be recreated to rule out a corrupted settings file.
KevinH is online now   Reply With Quote
Old 02-12-2018, 08:00 PM   #4
ChrisI
Enthusiast
ChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-books
 
Posts: 36
Karma: 847
Join Date: Sep 2007
Device: Sony PRS500
Platform: Windows 7 64-bit.

Sigil About Menu: Version 0.9.9, Loaded Qt 5.6.2

Problem Details:

Problem signature:
Problem Event Name: APPCRASH
Application Name: Sigil.exe
Application Version: 0.9.9.0
Application Timestamp: 5a3c2e1c
Fault Module Name: Sigil.exe
Fault Module Version: 0.9.9.0
Fault Module Timestamp: 5a3c2e1c
Exception Code: c0000005
Exception Offset: 0000000000035e0c
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: d518
Additional Information 2: d518e985c1e133e63c126fef71c422cd
Additional Information 3: 3b92
Additional Information 4: 3b928edad88f859fd7b40b3346f09b10


The book is copyrighted, but distributed without DRM. So is it legal to post it for debugging purposes?
ChrisI is offline   Reply With Quote
Old 02-12-2018, 08:07 PM   #5
ChrisI
Enthusiast
ChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-books
 
Posts: 36
Karma: 847
Join Date: Sep 2007
Device: Sony PRS500
I removed the Sigil.ini and let the system create a new one. No difference.
ChrisI is offline   Reply With Quote
Old 02-12-2018, 08:40 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 17,838
Karma: 90924686
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by ChrisI View Post
The book is copyrighted, but distributed without DRM. So is it legal to post it for debugging purposes?
No. Without explicit permission of the rights-holder, copyrighted works cannot be uploaded to Mobileread--regardless of its DRM status. What's the title? I'm usually willing to purchase a copy if it's not too terribly high-priced.
DiapDealer is offline   Reply With Quote
Old 02-12-2018, 08:42 PM   #7
ChrisI
Enthusiast
ChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-books
 
Posts: 36
Karma: 847
Join Date: Sep 2007
Device: Sony PRS500
There are four books, as part of the same series, that I just purchased. All of them exhibit the problem.

Looking at the books, what they all have in common is the first file is named "cover.xml"

I renamed this file to be "cover.xhtml" and that solved the problem.
ChrisI is offline   Reply With Quote
Old 02-12-2018, 09:02 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 17,838
Karma: 90924686
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I can recreate the problem. You're not attempting to split the .xml file, right? Because that should fail with a warning. It seems to only crash when a .xml file is the first file in the Book Browser treeview when splitting.

Thanks. We'll see if we can track it down. In the meantime, the workaround is to rename the .xml file (or temporarily drag it from the first position in the Book Browser treeview).

Last edited by DiapDealer; 02-12-2018 at 09:04 PM.
DiapDealer is offline   Reply With Quote
Old 02-12-2018, 09:24 PM   #9
ChrisI
Enthusiast
ChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-books
 
Posts: 36
Karma: 847
Join Date: Sep 2007
Device: Sony PRS500
You are correct, I am not attempting to split the xml file.

The error happens if you try to split any file.

The error also happens if you try to "Add Blank HTML File", from the context menu on the Text folder.

Thanks for replying so quickly. It is no problem to rename the file, so the fix is not urgent.
ChrisI is offline   Reply With Quote
Old 02-12-2018, 10:32 PM   #10
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,830
Karma: 1328806
Join Date: Nov 2009
Device: many
Wow, that is a strange one. I will try to recreate it on my Mac as well and try to get a backtrace from the crash. Thanks for finding and reporting this bug!
KevinH is online now   Reply With Quote
Old 02-13-2018, 08:31 AM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 17,838
Karma: 90924686
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
This affects Linux, as well. It crashes any time a Split at Cursor, or Add Blank HTML file is performed when a file with a .xml extension is the first file in the Book Browser's Text container.

Split at Markers gives the "Cannot split since at least one file may not be an HTML file" warning. Which seems a little odd when the .xml file isn't one that's marked for splitting. But it's preferable to a crash.

Last edited by DiapDealer; 02-13-2018 at 12:38 PM.
DiapDealer is offline   Reply With Quote
Old 02-13-2018, 11:04 AM   #12
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,830
Karma: 1328806
Join Date: Nov 2009
Device: many
Okay I added s new html file and then changed its name to .xml and and moved it to the top.

Then tried to create a new empty html file and it barfed with this backtrace:

Code:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.sigil-ebook.Sigil.app     	0x000000010fbf3484 Resource::GetEpubVersion() const + 4
1   com.sigil-ebook.Sigil.app     	0x000000010fba0b4c Book::CreateEmptyHTMLFile(HTMLResource*) + 44
2   com.sigil-ebook.Sigil.app     	0x000000010fed9072 BookBrowser::AddNewHTML() + 98
3   org.qt-project.QtCore         	0x000000011398bb4c QMetaObject::activate(QObject*, int, int, void**) + 3020
...
And the routine in question: CreateEmptyHTMLFile calls CreateNewHTMLFile almost immediately ...

Code:
HTMLResource *Book::CreateNewHTMLFile()
{
    TempFolder tempfolder;
    QString fullfilepath = tempfolder.GetPath() + "/" + GetFirstUniqueSectionName();
    Utility::WriteUnicodeTextFile(PLACEHOLDER_TEXT, fullfilepath);
    HTMLResource *html_resource = qobject_cast<HTMLResource *>(m_Mainfolder->AddContentFileToFolder(fullfilepath));
    SetModified(true);
    return html_resource;
}
The call to GetFirstUniqueSectionName actually defaults to use the same extension of the first file in the list (in this case a .xml file not an xhtml or html file).

The problem is then that raw xml files when added to FolderKeeper are not recognized as an html resource and instead is recognized as a misc xml resource since there is no mimetype passed along.

Code:
QString Book::GetFirstUniqueSectionName(QString extension)
{
    // If not files just return the default first name
    QList<HTMLResource *> html_resources = m_Mainfolder->GetResourceTypeList<HTMLResource>(true);

    if (html_resources.count() < 1) {
        return FIRST_SECTION_NAME;
    }

    // Get the extension of the current file
    QString first_html_file = html_resources.first()->Filename();
    QString first_html_filename = first_html_file.left(first_html_file.lastIndexOf("."));

    if (extension.isEmpty()) {
        extension = first_html_file.right(first_html_file.length() - first_html_file.lastIndexOf("."));

        // If no extension use the default first name extension
        if (extension.isEmpty()) {
            extension = FIRST_SECTION_NAME;
            extension = extension.right(extension.length() - extension.lastIndexOf("."));
        }
    }

    QString filename = FIRST_SECTION_PREFIX + extension;
    return m_Mainfolder->GetUniqueFilenameVersion(filename);
}
And then AddContentToFodler creates an miscellaneous XML resource object and that can not be cast to an HTMLResource *.

So we need to do a number of things in Book.cpp and FolderKeeper.cpp:

1. Teach it to treat files with pure xml extensions to default to xhtml files unless a specific mimetype is passed in that would indicate some other xml file.

2. When creating new html resources/files, we should pass in the correct mimetype so that AddContentToFolder in FolderKeeper actually knows we want a xhtml file regardless of the extension.

This may happen in a lot of places in the code base where empty xhtml files are created (such as the nav, toc.xhtml, etc) so we should search the code to handle that case and not rely on the file extension since it can be flakey.

I am away from my computer almost all day today, so I will try to fix this tomrrow evening in master. I think the same problem happens when splitting files because they start with a new blank xhtml file also.
KevinH is online now   Reply With Quote
Old 02-13-2018, 11:01 PM   #13
ChrisI
Enthusiast
ChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-booksChrisI has learned how to read e-books
 
Posts: 36
Karma: 847
Join Date: Sep 2007
Device: Sony PRS500
I'm curious...

Are there advantages to using different file types in an epub?

Why not, for example, just make every file .xhtml?

Perhaps there needs to be a system option for the user to select the file type for newly created files. In the case of split file, I would assume that the new file would be the same type as the file being split.
ChrisI is offline   Reply With Quote
Old 02-13-2018, 11:42 PM   #14
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,830
Karma: 1328806
Join Date: Nov 2009
Device: many
No in fact using different file types/extensions for text in the same epub is a huge pain in the ass. The epub3 standard recommends using only one: .xhtml. For epub2 you see both .xhtml and .html but the .html is a misnomer since proper xhtml is required.

Another problem is xhtml is xml but xml need not be xhtml. Any ebook author that tries to write chapters with mixed extensions is really just asking for trouble, imho.

I had never seen a book with a cover.xml followed by lots of .html or .xhtml files before. We can handle it but it really is not a good design approach for any ebook author.

Last edited by KevinH; 02-13-2018 at 11:54 PM.
KevinH is online now   Reply With Quote
Old 02-14-2018, 04:36 PM   #15
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,830
Karma: 1328806
Join Date: Nov 2009
Device: many
This is now fixed with the latest commit to Sigil master.
Thank you for your bug report which helped make Sigil better!

KevinH
KevinH is online now   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
Tool to split up double pages fodiator iRex 27 03-21-2012 10:03 AM
Plugin to split pages down the middle metafractal Plugins 5 12-12-2010 11:21 AM
How do I split two pages into one? Christopher888 PDF 4 11-20-2010 03:21 PM
Split pdf pages down the middle Blue_Alien Calibre 3 08-16-2010 12:12 AM
Classic Split PDF pages into smaller pages (images into tiles) Astro Barnes & Noble NOOK 3 07-28-2010 04:55 PM


All times are GMT -4. The time now is 09:05 AM.


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