Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 08-28-2017, 03:40 PM   #1
jddh
Junior Member
jddh began at the beginning.
 
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?
jddh is offline   Reply With Quote
Old 08-28-2017, 10:36 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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
kovidgoyal is online now   Reply With Quote
Advert
Old 09-01-2017, 03:24 PM   #3
jddh
Junior Member
jddh began at the beginning.
 
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:
<img src="img.jpg" alt="" />
With the referenced image in the same dir as the rest of the html files.

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.
jddh is offline   Reply With Quote
Old 09-05-2017, 09:35 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Old 09-26-2017, 08:27 PM   #5
jddh
Junior Member
jddh began at the beginning.
 
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?
jddh is offline   Reply With Quote
Advert
Old 09-26-2017, 10:15 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Old 10-06-2017, 03:27 PM   #7
jddh
Junior Member
jddh began at the beginning.
 
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:
Added [filepath]/[filename].jpg
But images referenced in the child pages, ie. HTML pages that are linked to from the TOC, are not imported. No mention of them in the logs when I import the HTML package.

But when I convert to MOBI, the app logs file not found errors for the images referenced in these child files:

Quote:
Referenced file u'[filename].png' not found
I get one of those errors for each and every IMG in the child HTML. They are not included in the Zip either. However the images in the TOC are included in the ZIP, and indeed in any format I convert to.

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?
jddh is offline   Reply With Quote
Old 10-06-2017, 09:26 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Old 10-19-2017, 07:32 PM   #9
jddh
Junior Member
jddh began at the beginning.
 
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.
jddh is offline   Reply With Quote
Old 10-20-2017, 12:29 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,748
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You are welcome and thanks for the donation
kovidgoyal 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
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


All times are GMT -4. The time now is 07:27 AM.


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