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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2010, 01:27 PM   #1
prdufresne
Junior Member
prdufresne began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kobo eReader
ePub with Images

I downloaded "Myths and Legends of Ancient Greece and Rome" by E.M. Berens from the Gutenberg Library in ePub format. I proceeded to add cover art to the file by converting the ePub to ePub using calibre.

When I began reading the book, I found that the images were overlapping the text. At first I thought the Kobo was at fault, but I opened the ePub in Calibre and it exhibits the same symptoms.

I went back to the original ePub I downloaded, and that version is fine. The images do not overlap the text, but appear to be displayed with the wrong aspect ratio.

It's almost as though calibre corrected the aspect ratio of the images without correcting the space required to display them. I don't know much about the ePub format, but this seems to be a bug in the way calibre converts ePub files with images.

Thoughts?
prdufresne is offline   Reply With Quote
Old 11-29-2010, 02:15 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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
it would be a lot easier to comment if you posted a link to the epub file
kovidgoyal is online now   Reply With Quote
Advert
Old 11-29-2010, 02:26 PM   #3
prdufresne
Junior Member
prdufresne began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kobo eReader
Good point. Here is the original ePub file I downloaded:

http://www.gutenberg.org/ebooks/22381.epub.images
prdufresne is offline   Reply With Quote
Old 11-29-2010, 05:08 PM   #4
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
A lot of Gutenberg files are not particularly friendly toward automatic conversion, as they use floating divs and other advanced epub features (in many cases of dubious value for a given ebook). This one is apparently formatted to expect an ultra-wide landscape view that doesn't exist in any e-readers I'm aware of - the aspect ratio issue with the images improves the wider you get. At a guess, Calibre is probably trying to make it fit your e-reader's screen based on your output profile.

You're best bet is to insert the cover using Sigil instead. That said, I think this epub may still not look great on an ereader.

Last edited by ldolse; 11-29-2010 at 05:10 PM.
ldolse is offline   Reply With Quote
Old 11-29-2010, 06:29 PM   #5
prdufresne
Junior Member
prdufresne began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kobo eReader
Hmmm... Interesting.

I'll have to do some more reading about the ePub format. I was expecting, like with HTML that the reader would wrap the text around the image by default, but it seems that the margin is just adjusted to account for the width of the image.

ThanX.

BTW: I do like that calibre corrected the image aspect ratio, but I wish it had adjusted the margin at the same time.
prdufresne is offline   Reply With Quote
Advert
Old 11-29-2010, 09:42 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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The original epub has rather asinine formatting, but there is a bug in calibre as well (calibre allows the value of the width and height attributes of the img to overwrite what is specified in the stylesheet).

I'm actually not clear whether that is a bug or not, but it is different from how most browsers interpret the HTML+CSS.
kovidgoyal is online now   Reply With Quote
Old 11-29-2010, 10:30 PM   #7
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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I changed the handling of width/height attributes in img tags to be closer to browser behavior, so if you wait for the next release epub->epub will fix those images.

If you care you should inform PG that they need to add

height:auto

to the css class of those images.
kovidgoyal is online now   Reply With Quote
Old 11-29-2010, 10:52 PM   #8
prdufresne
Junior Member
prdufresne began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kobo eReader
Thank you so much for taking the time to look into this little issue.

After doing a little bit of quick reading, I renamed one of my epub files to .zip and peeked at the file structure. The ePub format is far simpler then I had originally imagined, although I don't pretend to fully understand the relationship between all the files.

If I understand correctly, however, the cover image is stored in the same folder as the document files and I assume that one of the files specifies the name of the image file to use as the cover.

My problem would have been avoided completely if calibre had a "replace cover art" function avoiding the conversion from epub to epub.

At any rate, thank you for your help.
prdufresne is offline   Reply With Quote
Old 11-29-2010, 11:07 PM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by prdufresne View Post
After doing a little bit of quick reading, I renamed one of my epub files to .zip and peeked at the file structure. The ePub format is far simpler then I had originally imagined, although I don't pretend to fully understand the relationship between all the files.
FYI, to peak at future epubs just right click on it in the calibre library view and select tweak epub.
DoctorOhh is offline   Reply With Quote
Old 12-04-2010, 12:43 AM   #10
prdufresne
Junior Member
prdufresne began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: Kobo eReader
I just wanted to let you know that the change worked, and the new conversion no longer has images overlapping text. The images are quite small, but I expect that's due to the width of the image in the original epub file, and that only the height was corrected.

On another note, thanX to the response to dwanthny above, I've discovered that by using the tweak epub function, I can replace the cover.jpg file directly in the epub without converting it. However, if the file did not already include a titlepage.xhtml, I don't think the cover.jpg file will be shown by the reader. I'll have to play with this some more to be sure.

So if I'm right, changing the cover in the metadata in calibre does not change the epub file, and is therefore only a local change.

ThanX!
prdufresne is offline   Reply With Quote
Old 12-04-2010, 01:55 AM   #11
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
If cover.jpg already exists in the .opf file AND is referenced somewhere in the initial html/xhtml file then replacing it should work, though in some cases the dimensions of the original file may be referenced, so it might look weird if your new cover.jpg is different dimensions.

Calibre won't see the replaced cover unless you ask Calibre to re-update it's metadata based on the actual file.

If the file doesn't already exist and you just stick a cover.jpg file in it won't do anything. Technically you'd be creating an illegal epub, but most readers will just ignore the file.

Sigil is another option if you just want to edit the existing file without converting it.

Changing the cover using the Tweak epub feature does change the original file, whereas just updating the metadata using Calibre's GUI does not - at least not until you re-convert, use a save-to-disk feature, or send it to your reader - at that point the epub will be updated with the latest metadata Calibre has.
ldolse 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
Epub does not display images correctly Amalthia Calibre 3 09-05-2011 06:44 AM
Extracting images from an ePub MacEachaidh Sigil 2 11-08-2010 09:50 AM
Where are epub images stored? janneman Sigil 3 01-06-2010 04:43 AM
Help with images in EPUB conversions, please jackie_w Calibre 11 10-30-2009 03:29 PM
trouble with ePub cover images bossmanx9 Calibre 10 04-28-2009 06:16 PM


All times are GMT -4. The time now is 11:29 AM.


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