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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-17-2022, 05:51 AM   #1
Snomad
Member
Snomad began at the beginning.
 
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?
Snomad is offline   Reply With Quote
Old 01-17-2022, 10:18 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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)
theducks is offline   Reply With Quote
Old 01-17-2022, 04:13 PM   #3
Snomad
Member
Snomad began at the beginning.
 
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.
Snomad is offline   Reply With Quote
Old 01-17-2022, 05:12 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is offline   Reply With Quote
Old 01-17-2022, 05:43 PM   #5
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
Quote:
Originally Posted by Snomad View Post
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.
OK just to give an example, for most images in old magazines (pulp fiction type thing) I use this simple scheme:

Code:
<p class="center">

<img alt="" src="Pictures/img-2.jpg" class="widepic"/>

</p>
Where in the css:

Code:
.center {
  text-align: center;
  text-indent: 0;
  margin: 0.5em 0 0.5em 0;
}
.widepic {
  height: auto;
  width: 98%;
}
And I sometimes use a .narrowpic class where width: 50% if there are small images.

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.
retiredbiker is offline   Reply With Quote
Old 01-18-2022, 02:48 AM   #6
Snomad
Member
Snomad began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2021
Device: Onyx Book
Quote:
Originally Posted by retiredbiker View Post
OK just to give an example, for most images in old magazines (pulp fiction type thing) I use this simple scheme:

Code:
<p class="center">

<img alt="" src="Pictures/img-2.jpg" class="widepic"/>

</p>
Where in the css:

Code:
.center {
  text-align: center;
  text-indent: 0;
  margin: 0.5em 0 0.5em 0;
}
.widepic {
  height: auto;
  width: 98%;
}
And I sometimes use a .narrowpic class where width: 50% if there are small images.

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.
Okay, so I'm sure I've done this right.




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?
Snomad is offline   Reply With Quote
Old 01-18-2022, 03:17 AM   #7
Snomad
Member
Snomad began at the beginning.
 
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)
Snomad is offline   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
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


All times are GMT -4. The time now is 09:53 PM.


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