View Single Post
Old 12-11-2013, 10:38 PM   #124
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,045
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by phossler View Post
Is there a way that the plugin could create a more 'Sigil-friendly' file naming when it generates the merged epub, assuming that it's the file names that cause the mis-sorting?
EpubMerge, because it's combining files from different epubs, uses a different directory inside the epub zip file for the files from each source epub. That way it doesn't matter if different epubs had the same file names inside. And all relative links between files (be they html links, image tags, CSS, etc) are preserved without changing the content of the files. EpubMerge doesn't have to parse the content files at all.

Speaking from memory (I haven't tested it in a while), Sigil assumes that every file in the epub zip will have a unique name. And if there is an existing directory structure, it flattens that structure to suit its conventions, while parsing and changing the content files so that links reflect the new structure. That--especially if there are files with identical names in different directories--is the source of the problem.

So while EpubMerge could in theory produce 'Sigil-friendly' output, it would take additional work parsing files to change links and guaranteeing unique file names to do so. If somebody else wants to do it, I'd accept code contributions to make it an option, but I'm not planning to code it myself.

I don't have a problem with Sigil changing the content and structure to match its conventions. But since Sigil is the program that's misinterpreting valid epub files and is already parsing the files and changing all the links, I really think it's on Sigil to correct the way it reads epubs with directory structure.
JimmXinu is offline   Reply With Quote