![]() |
#1 |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2021
Device: Onyx Book
|
Problem with keeping images added to ebook
Some artwork was recently published for an existing book I have, so I thought I would try to add it to my epub copy.
I added the jpeg file to the book with no problem using edit book > insert image function in Calibre, however, when I tried to polish the book to compress the image it disappeared from the book and the report showed only 1 image (the cover) had been polished, there was no mention of it being removed. I also tried converting the book to see if that might cause the image to stay but again it just disappeared without any error messages. Does anyone know why this happens or how I can make sure the image will stay in the epub file? |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Add Image only inserts the FILE into the Structure.
You must also PLACE the (non-cover) image (into a proper code block), then save. Cover types have additional things that must be done (or use the cover tool) to declare both the Image and Page are the cover. Like the Highlander, there can only be 1 (set) |
![]() |
![]() |
![]() |
#3 |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2021
Device: Onyx Book
|
Okay, so what is the proper code block? Using the insert image function automatically generates the <img alt="Image" src="Image01.jpg" /> code inside the text which I thought was all that was needed, as it shows up fine in book viewer after saving it.
|
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,048
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The viewer is insanely forgiving (it is from part of a Web Browser . We all known that there is a ton of cr*p code out there)). Always test on a target device.
That block must be a P or Div block (those are Block Level types (as well as H#) An <img> ...</img> by it self is a naked set of tags. I think the Calibre Editor debug should have flagged those. I've add quite a few Alternate Covers (they are JUST images of the ones on my paperbacks and are NOT flagged as 'cover') Remember most semantics only allow ONE usage per book AND targets can not overlap It can't be a Cover AND also a TOC |
![]() |
![]() |
![]() |
#5 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
Quote:
Code:
<p class="center"> <img alt="" src="Pictures/img-2.jpg" class="widepic"/> </p> Code:
.center { text-align: center; text-indent: 0; margin: 0.5em 0 0.5em 0; } .widepic { height: auto; width: 98%; } If you want a full-page image put in, like an alternate cover, use the Insert Image tool with "Full page image" and "Preserve aspect ratio" checked -- that will get you a nice svg wrapper. Of course, alternate covers have to be in some file that is NOT marked as cover, as theducks said. |
|
![]() |
![]() |
![]() |
#6 | |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2021
Device: Onyx Book
|
Quote:
![]() ![]() I save the file and reopen it in the editor, everything is there. I close it and hit polish book, all the changes I've made, including to the stylesheet disappear. Have I misunderstood the function of the polish book tool? It shouldn't be doing that right? |
|
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 10
Karma: 10
Join Date: Oct 2021
Device: Onyx Book
|
Okay, I figured it out! The problem I was having was not the original problem I thought but actually, it was the same problem this person was having which you helped fix @theducks, where the orignal_epub was overwriting the changes made to the file.
Thanks @retiredbiker for posting the formatting template, I have very limited CSS knowledge so that's super helpful and will make the images fit in with the text nicely! (Also there was another reply I posted before I found the solution which is pending approval so just ignore that if you see it before I get a chance to delete it) |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with copying images from ebook-viewr | travis82 | Calibre | 2 | 11-06-2019 04:03 AM |
ebook viewer : problem with mixed pages. Images and text | tekkkkkk | Calibre | 1 | 12-25-2015 10:26 AM |
Keeping images on the same page as headers | indieauthor83 | Kindle Formats | 2 | 09-06-2015 12:11 PM |
Keeping Scanned Books As Images Only | Agent69 | Workshop | 3 | 11-16-2014 10:21 AM |
Epubs: keeping images and captions together | verydeepwater | ePub | 13 | 12-02-2012 04:33 PM |