![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Calibre
|
![]()
Hi all,
I recently converted an epub (which validates through epubcheck without problems) to mobi with Kindle Previewer. I used relative percentages in the <img> tags, but mobi format resizes all images to fit the whole width of the screen. In the original epub I have the following code for the images: <div> <p class="image"><img src="xxx"/></p> <p class="caption">Caption text</p> </div> The problem is that in mobi the image and the caption are not together; in the most cases the image resize to fit screen (width or height) and the caption appears in the next page alone. How could I resolve that? Thanks |
![]() |
![]() |
![]() |
#2 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,613
Karma: 6718541
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
|
Quote:
If you want to use KindleGen for the conversion you should spec each image with the desired pixel size for width and height explicitly, inside of the <img> tag itself. Quote:
|
||
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,412
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I've only ever had consistent luck controlling image size (using Kindlegen/Kindle Previewer) when I hard-code the sizes in the image tag:
<img src="../Images/my_picture.gif" height="120px" width="80px" /> EDIT: just as dwig said while i was fat-fingering my response. ![]() |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Calibre
|
Thanks dwig and DiapDealer.
So, if I undrestood you both well, it is no possible to assign a fluid with to images with Kindlegen, isn't it? |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,412
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
You should be able to jump through some hoops and specify the width, height attributes (in pixels) in the (x)html for the normal eInk kindle devices, and then override those html attributes with a CSS media query that would only apply to devices that support the KF8 format (like the Kindle Fire). Code:
@media amzn-kf8 { img.myclass {width:80%; height:auto} } I say should be possible because that's the way I'm interpreting the new Kindle Publishing Guidelines. I've not tested that case specifically, but I know the media queries can be used to specify different CSS for different devices. And CSS is supposed to take precedence over html attributes. I apologize if that was more information than you were looking for. ![]() Last edited by DiapDealer; 02-29-2012 at 07:19 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Calibre
|
Thanks, DiapDealer. There's never too much information...
![]() Then I wonder if I could apply your suggestion in the ebooks I'm making. I design the original for epub, so I use fluid width for all images: the result is valid in ADE, for example, or in my Sony PRS-T1. But my client wants to convert these epubs in mobi in order to sell them in Amazon. We've decided not to change the original epub (inserting fixed measures for images), but, according to your comments, it'd be possible to insert a media query for KF8 supported devices, isn't it? And another question: it'd be possible to maintain image and caption together (in .mobi format) using tables, for example? Or another resoruce... |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,412
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
In the main css file (that every html page links to): Code:
@import url(../Styles/epub.css); /* @import url(../Styles/mobi.css) amzn-mobi; @import url(../Styles/epub.css) amzn-kf8; */ I'm not sure. That's always going to be an issue in reflowable documents. Fixed-Layout KF8's can place captions directly on an image, but I don't think you can mix and match: an ebook is either Fixed-Layout or reflowable. Tables may work, but with MOBIs, bad things tend to happen when tables are used to achieve a certain "layout." Tables should only really be used when you have tabular data to present. Users can often easily "break" table layouts by increasing font-sizes (when they contain text). |
|
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Calibre
|
Thanks again.
A last question. Which are the most common differences/elements in order to be considered in MOBI format? I mean, like the trouble with images... |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
The ePub specific toc file will be used by KindleGen to create the chapter marks on the progress bar but not to create the Mobi specific TOC. It will need to be created separately. MobiPocket Creator can make this by identifying the rule used to create it such as all h1, h2 headers. |
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,412
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
In keeping with the above mentioned CSS conversion issues:
If you're trying to maintain one unified document for ePub and MOBI, keep in mind that kindlegen's css conversion logic can't cope with more than one class being assigned to a single element. so... Code:
<p class="first-class second-class">text here</p> Something like: Code:
<p class="first-class"><span class="second-class">text here</span></p> |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem with images - epub to mobi conversion | LynnGHughes | Kindle Formats | 18 | 04-17-2012 09:56 AM |
Calibre ePUB to mobi conversion help (with images) | anamardoll | Conversion | 6 | 02-19-2012 10:53 PM |
images lost converting epub to mobi | fwiginton | Calibre | 0 | 01-21-2012 12:21 PM |
epub to mobi error when including images | HarrisS | Conversion | 1 | 02-08-2011 08:57 AM |
help mobi to epub conversion: lost all images | Sylver | Calibre | 10 | 01-13-2011 08:31 PM |