Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2023, 11:51 PM   #1
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
Question Distorted images on Paperwhite Signature Edition

Yesterday, I received a Kindle Paperwhite Signature Edition as a gift, model: M2L4EK

It’s a beautiful device with a big and easy to read screen, certainly a big upgrade from my Kindle Keyboard 3G. Only, it doesn’t support EPUB, which my Keyboard 3G does, by means of Duokan. So I just converted Marina Abramović’s Walk Through Walls to AZW3 using Calibre 6.13 on Windows 10 Pro. As input profile I tried Kindle and Default, and as output profile I select Kindle Oasis because - per description - this is intended also for the Paperwhite 2021.

Unfortunately, the images are vertically stretched. It looks like there are two types of images. Some are stretched to fill the entire page, some half the page, minus caption. This issue does not exist in the original EPUB, and I could read the book just fine using Duokan.

Is there an easy fix?

(I wish there was a jailbreak for the device with a decent EPUB and PDF reader, or a dual boot solution with Duokan like for the Keyboard 3G.)
feklee is offline   Reply With Quote
Old 03-08-2023, 11:53 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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://www.mobileread.com/forums/sh...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 03-09-2023, 03:35 AM   #3
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
Quote:
Originally Posted by kovidgoyal View Post
OK, so I extracted the first chapter. Then I lorem ipsumized the text using the Chrome plugin LoremIpsumReplacer, and I pixelated the images using ImageMagick, only to find out:

The issue happens with AZW3, but not with MOBI.

Find the modded file attached. Seems like I damaged the meta data or something. There is an error, but it doesn’t influence conversion. The pixels in the images should be squared. With the AZW3 in many images they are distorted.

I am happy to provide more info, but for me the issue seems to be solved. I simply convert from EPUB to MOBI instead of to AZW3.
Attached Files
File Type: epub draft.epub (359.7 KB, 73 views)
feklee is offline   Reply With Quote
Old 03-09-2023, 04:45 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by feklee View Post
Yesterday, I received a Kindle Paperwhite Signature Edition as a gift, model: M2L4EK

It’s a beautiful device with a big and easy to read screen, certainly a big upgrade from my Kindle Keyboard 3G. Only, it doesn’t support EPUB, which my Keyboard 3G does, by means of Duokan. So I just converted Marina Abramović’s Walk Through Walls to AZW3 using Calibre 6.13 on Windows 10 Pro. As input profile I tried Kindle and Default, and as output profile I select Kindle Oasis because - per description - this is intended also for the Paperwhite 2021.

Unfortunately, the images are vertically stretched. It looks like there are two types of images. Some are stretched to fill the entire page, some half the page, minus caption. This issue does not exist in the original EPUB, and I could read the book just fine using Duokan.

Is there an easy fix?

(I wish there was a jailbreak for the device with a decent EPUB and PDF reader, or a dual boot solution with Duokan like for the Keyboard 3G.)
You actually want Input profile to be Default profile and Output profile to be Tablet. That way the images are not changed at all. With your current settings, images are modified.
JSWolf is offline   Reply With Quote
Old 03-09-2023, 06:12 AM   #5
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
Quote:
Originally Posted by JSWolf View Post
You actually want Input profile to be Default profile and Output profile to be Tablet. That way the images are not changed at all. With your current settings, images are modified.
I tried, and with input Default and output Tablet, I get the same issue in the AZW3 file. Note that the images are not uniformly stretched by a factor. Instead they seem to be stretched either to fill 50% of the height or 100%, minus caption.
feklee is offline   Reply With Quote
Old 03-09-2023, 06:43 AM   #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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The markup in that file is causing the distortion, since it hardocdes widths for the images. AZW3 supports such markup MOBI does not.
kovidgoyal is offline   Reply With Quote
Old 03-09-2023, 06:54 AM   #7
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
Quote:
Originally Posted by kovidgoyal View Post
The markup in that file is causing the distortion, since it hardocdes widths for the images. AZW3 supports such markup MOBI does not.
Thanks for looking into it. What fix do you recommend?

(MOBI looks fine to me, so maybe I don't even need a fix.)
feklee is offline   Reply With Quote
Old 03-09-2023, 07:39 AM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by feklee View Post
Thanks for looking into it. What fix do you recommend?

(MOBI looks fine to me, so maybe I don't even need a fix.)
Post a the section of the html code that displays the images and any relevent CSS code. We can take a look. It would be good to know what's going on if you want to fix a similar issue in the future.
JSWolf is offline   Reply With Quote
Old 03-09-2023, 09:23 AM   #9
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You would need to remove the width attribute from all img tags which can be done via the Transform HTLM tab of the Look & feel section of the conversion dialog.
kovidgoyal is offline   Reply With Quote
Old 03-19-2023, 03:40 AM   #10
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
Quote:
Originally Posted by kovidgoyal View Post
You would need to remove the width attribute from all img tags which can be done via the Transform HTLM tab of the Look & feel section of the conversion dialog.
Thanks for the suggestion. Here is an example of an image that gets heavily stretched vertically across an entire page, minus caption (code reformatted by me):

Code:
<div class="img_wrap" id="div12">
  <div class="block_51" id="c01-fig7">
    <div class="squeeze squeeze51_0">
      <img
        alt=""
        class="squeeze-epub"
        src="images/Abra_9781101905050_epub3_010_r1.jpg"
        style="width:100%;"
      ><img
         alt=""
         class="squeeze-amzn"
         height="373"
         src="images/Abra_9781101905050_epub3_010_r1.jpg"
         width="284">
    </div>
  </div>
  <p class="caption" id="p60"> eirmod tempor invidunt ut labore et dolore </p>
</div>
What I tried as transformation rule:


However, all that this does is create two equally stretched images. First, I tried just removing width, and when that didn't work, I just remove pretty much everything.

(note that I'm fine exporting to mobi, but I'm also happy to continue testing Calibre in case that helps)
Attached Thumbnails
Click image for larger version

Name:	rule.png
Views:	212
Size:	49.9 KB
ID:	200465  
feklee is offline   Reply With Quote
Old 03-19-2023, 07:29 AM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,164
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
if width or height is a percent (like 75% or 100%), the other property must be auto, because that percent is enclosing thing size, not image size, so
width: 50%;
height: 50%;
doesn't give a half size image, it will stretch to half height and width of the screen by default.

If the image is really 800 x 600 pixels (w x h) then these work

Absolute sizing
height: 300px;
width: 400px;

Set based on width and 2.5% of screen margin
height: auto;
width: 95%;

Or if it's a portrait image 1080 wide and 1920 high and you want it a 1/3rd of page
height: 33.3%;
width: auto;


If you want it centred put it in a p or div
<p class="centred"><img class="size2" src="images/image.png" alt="descriptive text"/> </p>
<p class="centred">Some caption</p>

.size2 {
height: auto;
width: 50%
}

.centred {
display: block;
font-family: "Droid Sans", sans-serif;
font-weight: bold;
margin-bottom: 0.5em;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: center;
text-indent: 0

}

This class will do for a caption too.
Never use "auto" with any margin or padding property.
Quoth is offline   Reply With Quote
Old 03-19-2023, 08:07 AM   #12
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
Thanks, but I'm not the one who writes that code. I just try to convert, and I realize that the file displays fine as EPUB, and it also displays fine on my Kindle when converted to MOBI. It does not, however, display fine on my Kindle when converted to AZW3.

In the snipped that I posted, I'd say things look OK. The image is included twice. Apparently the software used for viewing just hides the instance that is not applicable.

For the first instance, the width is specified, so that the height can be selected proportionally by the viewer. There should be no stretching:

Code:
<img
  alt=""
  class="squeeze-epub"
  src="images/Abra_9781101905050_epub3_010_r1.jpg"
  style="width:100%;">
In the second instance, the dimensions are hardcoded in about the aspect ration of the image, again no excuse for extensive stretching:

Code:
<img
  alt=""
  class="squeeze-amzn"
  height="373"
  src="images/Abra_9781101905050_epub3_010_r1.jpg"
  width="284">
The size of Abra_9781101905050_epub3_010_r1.jpg is 1200×1600 pixels.
feklee is offline   Reply With Quote
Old 03-19-2023, 09:19 AM   #13
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,164
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
This should never be done in an img tag in ebooks, though OK on a web page:
style="width:100%;"
or
height="373"
src="images/Abra_9781101905050_epub3_010_r1.jpg"
width="284"

1) style="width: etc" in an img tag is a different thing to width="pixels" in an img tag

2) width & height should only be set in CSS, never in the the img tag because some ereader renderers will ignore it.

3) Never set width or height without setting both.

Inline attributes are a poor idea in epub2, epub3 and azw3/KF8

What is the CSS of class="squeeze-epub" ? That could be messing up the images.

Each image that't differently styled should have a class in CSS file.

Some eReader renderers work differently to web pages. The PC viewers are usually using a web browser so will work when epub, kepub, azw3/KFX, mobi/KF7 or KFX on eink fails.
Quoth is offline   Reply With Quote
Old 03-19-2023, 09:22 AM   #14
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,164
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Here is classic difference:
Quote:
<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">

<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
<area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">
</map>
This is trivial client side image map code that needs no javascript and allows an interactive image. You could make a click & point plot your own adventure with images rather than text.

It won't work on most ereaders, in ebooks, sadly.

This also often won't work (fine for web sites)
Quote:
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 50%;
}
For ereaders it needs to be an image inside p or div tags using class="centred"
Example makes ALL images 50%, so you'd have a class for each size.

Quote:
img {
height: auto;
width: 50%
}

.centred {
display: block;
margin-left: 0;
margin-right: 0;
text-align: center;
}

Last edited by Quoth; 03-19-2023 at 09:30 AM.
Quoth is offline   Reply With Quote
Old 03-19-2023, 09:39 AM   #15
feklee
Member
feklee began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2013
Device: Kindle M2L4EK
I'll stick to MOBI. That works, no need for AZW3.
feklee is offline   Reply With Quote
Reply

Tags
mobi conversion


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please, need help with Kindle Signature Edition Blue2u Amazon Kindle 9 09-02-2022 11:15 AM
Troubleshooting What would cause a Paperwhite 5 Signature Edition to go into a boot loop? mbrisco Amazon Kindle 0 08-27-2022 06:30 AM
Sell 2x Kindle Paperwhite Signature (Australia) lkws1 Flea Market 1 06-24-2022 11:21 PM
I just got a PW5 signature edition Averagekindlefan Amazon Kindle 11 05-04-2022 11:43 AM
CBZ to MOBI -> Getting distorted images Skeeve Conversion 4 04-14-2014 02:27 PM


All times are GMT -4. The time now is 01:16 PM.


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