12-03-2009, 12:50 AM | #1 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
importing html does not import images
hello all,
first the basic : calibre 0.6.24 OS : linux mandriva 2010 device (not recognised) hp hx2752 with wince 2003 I have created a html ebook with images. when I add it in calibre, it seems to come without the images I have a index.html and all images are in the same directory that the index file I tried previously to have the files in a sub-dir, but it did not work as well I can open the ebook in a browser and I get it complete, with images, but if I add it to calibre then convert it to any format, the images are lost (represented by an empty square) my prefert format is mobi but I tried epub, pdf.... none came with the images I created a html file with the table of content as in the FAQ, but I get the dame, with a TOC in front I converted all the files to a zip file that I draged into calibre the try to convert it but I get an error message during conversion this is the result from ebook-convert on the console ebook-convert electronique.zip electronique.mobi Processing archive... 1% Converting input to HTML... InputFormatPlugin: HTML Input running on /tmp/calibre_0.6.24_ZCZZCi_plumber/index.html Language not specified Creator not specified Title not specified Building file list... 34% Running transforms on ebook... Merging user specified metadata... Detecting structure... Auto generated TOC with 0 entries. Flattening CSS and remapping font sizes... Traceback (most recent call last): File "/tmp/init.py", line 48, in <module> File "/home/kovid/build/calibre/src/calibre/ebooks/conversion/cli.py", line 249, in main File "/home/kovid/build/calibre/src/calibre/ebooks/conversion/plumber.py", line 804, in run File "/home/kovid/build/calibre/src/calibre/ebooks/oeb/transforms/flatcss.py", line 123, in __call__ File "/home/kovid/build/calibre/src/calibre/ebooks/oeb/transforms/flatcss.py", line 167, in baseline_spine ValueError: max() arg is an empty sequence help ? |
12-03-2009, 01:44 AM | #2 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use relative paths in your html files.
|
Advert | |
|
12-03-2009, 07:50 AM | #3 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
hello,
thanks for the reply this is the kind of code I use in the file, it is relative path I beleive as the images are now in the same directory that the html file <img alt="Principles of Electricity" src="e101.gif" border="2"> reup |
12-03-2009, 10:33 AM | #4 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
When you add the html to calibre, does it create a zip file?
|
12-03-2009, 11:36 AM | #5 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
yes it does,
I went to the library and open the zip file, there is only the html toc file, the main document html file and some files I believe for the database information, but no png, mpg or other image files I am trying to add the files manually to the zip, I doubt it will work, but who knows ? (you probably :-) ) reup |
Advert | |
|
12-03-2009, 11:54 AM | #6 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's really strange. Can you zip up and attach your files to a ticket. I'll take a look when I have a moment.
|
12-03-2009, 02:12 PM | #7 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
unfortunately I cannot, I download this from a site on internet and I am very sure that the copyright forbid me to do that
I am in brazil and have a very small connection, so to learn electronics, it was better for me to download the site (wget) and turn it to ebook for my old ipaq. but I do not want to put myself and you into some juridic issue just because of my thirst for knowledge :-) I will create a dummy page with images and see if the issue is linked to my system (OS version or other) or if it is linked to some issue with the html that I try to convert thanks for your time, I will keep you posted here reup |
12-03-2009, 02:18 PM | #8 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
this could help, I try to convert and I looked at the log during conversion :
InputFormatPlugin: HTML Input running on /tmp/calibre_0.6.24_KjclhD_plumber/content.opf Parsing all content... Manifest item 'toc.ncx' not found Parsing electronique.html ... Parsing index.html ... Referenced file 'magnet6.jpg' not in manifest Referenced file 'alt1.jpg' not in manifest . . . I can confirm that the file magnet6.jpg is in the directory. as well as in the zip file as I copy it manually there reup |
12-03-2009, 02:28 PM | #9 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
content.opf is not referencing the images files. maybe if I could add the lines by hand
toc.ncx does not exist as well : <?xml version='1.0' encoding='utf-8'?> <package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="uuid_id"> <opf:metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlnspf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:identifier id="uuid_id" opf:scheme="uuid">514f36fe-282c-4e97-890f-5b2a483a3bd1</dc:identifier> <dc:title>Unknown</dc:title> <dc:language>en_GB</dc:language> <dc:creator>Unknown</dc:creator> </opf:metadata> <manifest> <item href="index.html" id="added" media-type="application/xhtml+xml"/> <item href="electronique.html" id="html" media-type="application/xhtml+xml"/> <item href="toc.ncx" media-type="application/x-dtbncx+xml" id="ncx"/> </manifest> <spine toc="ncx"> <itemref idref="html"/> </spine> <guide/> </package> reup |
12-03-2009, 04:06 PM | #10 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The manifest errors are just warnings. calibre automatically adds missing files to the manifest when converting.
|
12-04-2009, 09:24 PM | #11 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
kovidgoyal,
I have created a directory with a simple html that load one image (code was taken from my file that does not convert, the image as well), I created a TOC file, then I import the TOC file, got a zip file, I converted it to mobi and it worked well so it seems that something is wrong in my original html/images could it be the size ? no images are bigger than 50k and the html is 290K but all together it is 1.9Mb I recently converted it to pdf but the file is 8Mb and the pdf reader on my device is so crap that I cannot read properly the course (I have to scroll left and write or use letters so little that I cannot see them) I try to convert the pdf to mobi but the images fly all over the place so I have 2 ideas here 1 there is a size issue 2 there is some codes that stop the conversion reup Last edited by reup; 12-04-2009 at 09:26 PM. |
12-04-2009, 11:04 PM | #12 |
creator of calibre
Posts: 44,336
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
when you import if the resulting zip file does not contain the images then something in the html is causing a problem
|
12-08-2009, 08:52 PM | #13 |
Connoisseur
Posts: 58
Karma: 10
Join Date: Jul 2009
Device: hp ipaq hx2750
|
after I added the images manually in the zip files, then checked the database and restarted calibre few times, the files is seen now with the right size and the convert works
I just have now to find a way to keep the images at the right size and at the right place thanks a lot reup |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
HTML + Images = MOBI without Images | SunLight | Amazon Kindle | 5 | 08-25-2012 02:27 PM |
HTML importing problem | PaladinBL | Sigil | 13 | 03-16-2010 05:03 PM |
Importing HTML Files | Shadowlane | Calibre | 1 | 12-19-2009 03:04 PM |
Importing multiple images | pedgarcia | Sigil | 5 | 10-28-2009 12:38 PM |
Looking for Advice with an HTML Importing Problem | deanstow | Calibre | 2 | 10-03-2009 05:14 PM |