![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Aug 2016
Device: Cybook Odyssey
|
![]()
Hello, I have tried to solve this for few hours and I am stuck.
I am trying to convert my book from amazon (Java: The Complete Reference) to epub so I can read it on my Cybook Odyssey. After conversion it seems that the images are cropped (at least from left/right) by few pixels. Since code examples are in image (jpg) form it makes the book unusable, because important elements, like semicolons, parentheses etc. are often located near the borders. I tried to limit max width with Code:
div span img { max-width: 90% !important; } Code:
div span img { max-width: 530px; } I think that I can eventually use some workaround by processing those images and adding few more pixels on each border - but I don't know how to access them. Solution: I downloaded images using book editor, edited them, then put it back to the book. It didn't work well with epub (don't know why - maybe I did something wrong), but it works with original AZW3 file. I added 5px white border to images using ImageMagick tools (workaround so my reader just cuts those white border and not the actual image). Additionally I adjusted size and sharpened all images, so my reader won't have to change resolution on the fly (for quality and readability). I also set a bit of negative left margins during conversion, so that the images could be a bit wider. The code is now much more readable than in the original files provided by Amazon ![]() If this can be helpful for anyone, here are command line examples on how to batch change size and sharpeness: Code:
magick mogrify -format bmp *.jpeg //convert every jpeg image to bmp for further loseless processing magick mogrify -filter Mitchell -resize 550x730^> -format bmp *.bmp //downscale images that are wider than 550px or higher than 730px, leaving smaller images untouched magick mogrify -bordercolor white -border 5x3 -unsharp 0x1.1+2+0 -format jpeg *.bmp //add white border and sharpeness to every bmp image and save back as jpeg Code:
div span img { margin-left:-15px; } Last edited by dr_Fell; 06-30-2018 at 03:10 AM. Reason: Solution found |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,173
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre does not crop images during conversion, this is a bug in the reader you are using. And if you want to access the images, simply edit the azw3 using the calibre editor or use the unpack book tool.
|
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Aug 2016
Device: Cybook Odyssey
|
I managed to download images from book, add small white border to every one of them, then I deleted original images in Calibre editor and uploaded modified images with same names. Unfortunately new images are not visible... What am I doing wrong?
|
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,046
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
What you need to do to stop the images from being modified is to change the output profile to TABLET. By setting the output profile to tablet, Calibre will not resize the images at all.
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Aug 2016
Device: Cybook Odyssey
|
Quote:
If only I could replace images from epub with my modified versions, that would probably fix the problem. Any idea why this doesn't work? New images being a bit bigger than old versions (14 points wider and 6 points higher) could be the cause? |
|
![]() |
![]() |
![]() |
#6 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Aug 2016
Device: Cybook Odyssey
|
Thank You all for help! Problem seem to be solved. I have paid a lot of money (at least for me) for that book and I am glad I can use it now
![]() I downloaded graphics, edited them, then put it back to the book. It didn't work well with epub (don't know why), but it works with original AZW3 file. I added 5px white border to images using ImageMagick tools (workaround so my reader just cuts those white border and not the actual image). Additionally I adjusted size and sharpened all images, so my reader won't have to change resolution on the fly (for quality and readability). I also set a bit of negative left margins during conversion, so that the images could be a bit wider. The code is now much more readable than in the original files provided by Amazon ![]() If this can be helpful for anyone, here are command line examples on how to batch change size and sharpeness: Code:
magick mogrify -format bmp *.jpeg //convert every jpeg image to bmp for further loseless processing magick mogrify -filter Mitchell -resize 550x730^> -format bmp *.bmp //downscale images that are wider than 550px or higher than 730px, leaving smaller images untouched magick mogrify -bordercolor white -border 5x3 -unsharp 0x1.1+2+0 -format jpeg *.bmp //add white border and sharpeness to every bmp image and save back as jpeg Code:
div span img { margin-left:-15px; } @davidfor - what do You mean by "post the code"? What code besides CSS styles can I post here? Debugger output? I couldn't find "unpack book" feature - where is it located? This could be much faster than deleting and then uploading almost 2000 files using book editor... Last edited by dr_Fell; 06-30-2018 at 03:12 AM. |
![]() |
![]() |
![]() |
#8 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#9 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,893
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Aug 2016
Device: Cybook Odyssey
|
![]() |
![]() |
![]() |
![]() |
Tags |
azw3, calibre, conversion, cybook, epub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Images from AZW3 Lonely Planet books are downsampled in ePub output | wealthychef | Conversion | 3 | 05-27-2018 10:34 AM |
EPUB to MOBI (AZW3). Black SVG images with CSS styles | uka | Conversion | 6 | 03-04-2018 09:50 PM |
Calibre Epub to AZW3: Scale images to fit Voyage/PW? | cw30000 | Conversion | 3 | 07-08-2017 12:10 AM |
Images going from ePub tu mobi or azw3 format | valegar44 | Kindle Formats | 2 | 09-09-2014 01:07 AM |
Conversion from epub to azw3 | Joy736 | Conversion | 12 | 01-01-2013 11:00 AM |