Quote:
Originally Posted by DiapDealer
Can I ask why the image links in the html use absolute file:/// urls for the src attributes in the first place? It's not a very common practice. Relative paths make everything very portable and easily/quickly relocatable.
|
Well, that's a pretty long story, but - at the risk of boring you - I'll tell it, since it may help others as well.
Fundamentally, what I'm trying to produce is an ebook about music: it consists of text plus short snippets of audio (mp3s) and related small sheet music images (jpgs/pngs). For various design reasons, these audio and image pieces are presented in a popup box triggered by a highlighted link in the text. If the reader decides to click on the link, the windows pops up, displaying the audio player and related sheet music snippet; once he's done, the reader clicks the Close button in the corner of the popup box and is returned to the text. The ebook contains numerous links like that and consists of several chapters.
As you can imagine, this type of project involves a lot of html/css hacking; unfortunately, Sigil isn't the ideal platform for that and I have had to struggle with it over the last few weeks. At some point I decided it would be a good idea to try to develop the project as a website, using CoffeeCup as the html editor, see if that makes it easier to get the design work done and then import it into Sigil and let Sigil turn it into an epub.
As an experiment, I copied into a CoffeeCup folder the html of part of one chapter and its related css file, with about a dozen popup boxes. I opened it in CoffeeCup; it opened fine, but I had to convert the Sigil relative src="../ addresses of the media files to their absolute address in the original (non-Sigil) folder where they reside. Everything went smoothly. The sample chapter opened in Firefox with all the text, the popup boxes and the popup content without a hitch.
At that point I figured it's time to convert the sample chapter into an epub. Back to Sigil I went - I opened the HTML page in Sigil; I don't know if that, in and of itself, caused some or all the problems - but I didn't (like you suggested) use Add Exiting, just plain Open, navigated to the folder where the HTML page was located, changed the Sigil default Open mask from .epub to .html and loaded the page. As I mentioned in a previous message, the page and its related css loaded perfectly, but the media files did not. As you suggested, I converted the absolute addresses to relative addresses in the Sigil html file and everything was fine and behaved exactly as expected. I saved it as an epub3 file.
Now the fun and games started - I tried opening that epub with the Firefox epub reader extension; it wouldn't open (this may be an issue with the extension, not the epub). I tried to open it with Adobe Digital Editions; the book opened with all the links highlighted in the right places, but the popup boxes just didn't pop up.
Finally, I copied the epub to my android tablet. None of the supposed android epub3 readers would even open the file, except for one: Gitden Reader. When it opened, the text itself and highlighted links were fine. However, clicking on the links resulted in one of the flowing outcomes:
1. Nothing happens.
2. A blank popup box pops up.
3. A popup box with an image but not the related audio.
4. A popup box with a blank audio player (with or without the related image), but no related audio.
And, finally, for a small percentage of the links:
5. The intended result: a popup box containing both an image and an audio snippet that could actually be played and closed properly.
So, in my infinite wisdom, I decided to go back to Sigil to see what went wrong in the process of converting a working html/css file to an epub. And that was when I discovered, upon re-opening the epub in Sigil, that the text was fine, but that all the media files were gone - so each popup box did popup, but it contained only two of those Xs indicating the referenced file is missing.
And that's how I got to where we are today. This is probably far more than you wanted to know but, as I said, it may help someone else avoid the same issues...