08-28-2017, 03:40 PM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Aug 2017
Device: Kindle Paperwhite
|
Can images be embedded in HTML > MOBI?
Thank you Kovid and team for this amazing software.
I'm bundling HTML files into MOBI packages via the HTML to ZIP plugin. I tried referencing some local images in the html, but they appear to not be copied into the MOBI. Is it possible to reference the images such that they would appear on my Kindle? |
08-28-2017, 10:36 PM | #2 |
creator of calibre
Posts: 43,748
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Local images are handled automatically, provided the reference to them is correct. Easiest id to use relative paths, if you use absolute paths, the syntaxh is
file:///C:/path/to/file.jpg on windows and file:///path/to/img.jpg on other OSes |
Advert | |
|
09-01-2017, 03:24 PM | #3 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Aug 2017
Device: Kindle Paperwhite
|
Hi Kovid, thanks very much for the response.
I've been adding images like this: Quote:
However Calibre includes the tag (there's a space in the MOBI page for the image), but not image. If I manually unpack the MOBI (or EPUB, if I try that conversion), the image is not included in the bundle. |
|
09-05-2017, 09:35 PM | #4 |
creator of calibre
Posts: 43,748
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That should be fine. First look at the zip file to see if the images are included there.
|
09-26-2017, 08:27 PM | #5 |
Junior Member
Posts: 5
Karma: 10
Join Date: Aug 2017
Device: Kindle Paperwhite
|
Oddly they are not included in the .zip or any other converted format. Do I need to enable any setting in MOBI output or otherwise?
|
Advert | |
|
09-26-2017, 10:15 PM | #6 |
creator of calibre
Posts: 43,748
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No there are no settings needed. Images are added to the zip file automatically.
|
10-06-2017, 03:27 PM | #7 | ||
Junior Member
Posts: 5
Karma: 10
Join Date: Aug 2017
Device: Kindle Paperwhite
|
Hi Kovid, thanks again for corresponding. I had a look at Calibre's logs and have more details.
Images that are referenced in the TOC HTML file, i.e. the file I drag into Calibre, are imported. I see Quote:
But when I convert to MOBI, the app logs file not found errors for the images referenced in these child files: Quote:
So it would appear that the issue is that images referenced in the child HTML files are not initially copied over when I add the TOC file to Calibre. Should I file a bug? |
||
10-06-2017, 09:26 PM | #8 |
creator of calibre
Posts: 43,748
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That will be because the images are not referenced correctly in the child HTML files, probably you forgot to adda leading ../ or similar. But if not feel free to opena bug report and attach a minimal example to reproduce.
|
10-19-2017, 07:32 PM | #9 |
Junior Member
Posts: 5
Karma: 10
Join Date: Aug 2017
Device: Kindle Paperwhite
|
Hi Kovid — I waded deeper into the logs. The issue in fact was that the child HTML pages were failing to be parsed as simple HTML and so Calibre gave up on the IMG references. The child pages were eventually parsed and bundled; the images were not.
I was producing the HTML pages with an abbreviated structure, going straight to content. So I modified the child HTML pages to start with <!DOCTYPE html><html><body> and finished by closing BODY. The images work now! Thank you for your correspondence. I just made a donation to Calibre. |
10-20-2017, 12:29 AM | #10 |
creator of calibre
Posts: 43,748
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You are welcome and thanks for the donation
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
images on top when html to mobi | dxcqcv | Conversion | 0 | 10-26-2014 02:38 AM |
Uploading ePub to KDP allows >127K images in mobi (hooray!) but strips embedded fonts | Peter Ahlstrom | Kindle Formats | 4 | 10-24-2014 11:30 AM |
EPUB->MOBI Links embedded in images being lost | oldghost | Conversion | 2 | 03-02-2014 04:38 AM |
HTML + Images = MOBI without Images | SunLight | Amazon Kindle | 5 | 08-25-2012 02:27 PM |
No Images When HTML Converts to Mobi -Why? | Akua | Conversion | 4 | 11-22-2011 01:52 AM |