Quote:
Originally Posted by JimmXinu
And actually, no I didn't do a name collision check. In theory, it would be nice, but seriously, if your epub has chap01.htm and chap01.xhtml in the same dir in the same epub, you have bigger problems.
|
That’s a wonderful theory for primary content, but it can fail rather horribly when considering frontmatter, backmatter, and auto-generated content. (Example: An EPUB 3 toc.xhtml navigation document can happily coexist with a frontmatter toc.html table of contents. Similar content, different purposes, one visible to the user and one not, and overwriting one with the other will break the EPUB.
This is not at all rare.) Plus, have you
seen ebooks? Many of them
do have big problems, and at the very least, our duty is to not make those worse.
A name collision check should be regarded as mission-critical, especially given the possibility of data loss and how trivial it is to fix. If a collision is found, just set up a counter and keep testing (name)_(counter).(extension) until you find an available name. Boom, done.