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 08-01-2024, 07:06 PM   #1
tomsem
Grand Sorcerer
tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.
 
Posts: 6,597
Karma: 26963509
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
Fixed layout ePub converted from AZW3 displays black pages

I am trying to convert a manga AZW3 to ePub. The conversion is 'successful', and calibre viewer displays something (but with issues), but Apple Books and Thorium Reader only show black pages.

It seems perfectly okay when converted to KEPub for Clara Colour, but sending it 'as is' to my PB InkPad Color 3, it includes a black rectangle with the image overlaid on top of it (resulting in 2 pages) and I don't know what accounts for that (if I convert to PDF with calibre this black rectangle shows in the same way). It also has black rectangles in calibre viewer (resulting in 2 pages).

(I edited the AZW3 to add ToC entries before conversion.)

I have tried both calibre direct conversion and also KindleUnpack's, with the same symptoms.

I am able to produce a 'working' ePub using Kindle Comic Converter with extracted images, but page order is all messed up because the image numbering in the AZW3 does not follow the page sequence.

The HTML in the AZW3 is different than that from the other manga AZW3's that convert well: the latter have 2 top-level <div> tags, each of which contains <img> tag for the page image in each. The AZW3 that converts to 'black rectangle' ePub has only the first of these <div> sections.

I have 2 ideas for workaround:

1. Rename image files using a script to read the manifest in metadata.opf to determine order and generate ePub with KCC. (but need to match spine id to an html file and read image filename from the <img> tag there, or just trust that html filenames sort into the correct order)

2. convert to KePub and back to ePub. <-did not work

Last edited by tomsem; 08-01-2024 at 11:25 PM.
tomsem is online now   Reply With Quote
Old 08-02-2024, 02:10 AM   #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: 44,179
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Either the inmages are in a format apple books and thorium dont like or there is some css they dont like. do an image conversion to png for one of the internal images and see if it works and delete the css stylesheet and see if it works.
kovidgoyal is online now   Reply With Quote
Advert
Old 08-02-2024, 05:20 PM   #3
tomsem
Grand Sorcerer
tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.
 
Posts: 6,597
Karma: 26963509
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
Quote:
Originally Posted by kovidgoyal View Post
Either the inmages are in a format apple books and thorium dont like or there is some css they dont like. do an image conversion to png for one of the internal images and see if it works and delete the css stylesheet and see if it works.
Yes, those are just worst case, where black is 'foreground'. Calibre viewer and PocketBook also display black 'background' rectangles and I cannot account for where those come from. The CSS seems pretty basic. The images themselves are not the issue.

I think it is some styling in the HTML files, but there are 200 of them. So it looks like it is either going to involve updating all of the HTML files, or renaming the images so they are in the proper sort order, and then building an ePub from those.

I'll try to create a minimal example that demonstrates the issue.

Last edited by tomsem; 08-02-2024 at 06:41 PM.
tomsem is online now   Reply With Quote
Old 08-02-2024, 06:09 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 38,158
Karma: 152037714
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Last time I edited an ebook with over 100 stylesheets, they were identical and short. All the real styling was done using a mix of styles declared at the start of each text file and inline styles.

Here's what there were 173 stylesheets worth of:

Code:
@page {
  padding: 0pt;
  margin: 0pt;
}

body {
  text-align: justify;
  padding: 0pt;
  margin: 0pt;
}
DNSB is offline   Reply With Quote
Old Yesterday, 10:45 PM   #5
tomsem
Grand Sorcerer
tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.tomsem ought to be getting tired of karma fortunes by now.
 
Posts: 6,597
Karma: 26963509
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
Attached is a two page book (AZW3 & ePub converted by calibre) that demonstrates the issue.

I created new AZW3 with calibre Edit, copied the (only) CSS file from the AZW3 for the book I've been trying to convert, and took one of the HTML pages, updated 'page' and pointed it at the 'cover' and 'page' image files PS beta generated for me. The image dimensions are exactly the same as those in the original AZW3.
Attached Files
File Type: azw3 Test - Tom S.azw3 (741.4 KB, 5 views)
File Type: epub Test - Tom S.epub (1.04 MB, 7 views)
tomsem is online now   Reply With Quote
Advert
Old Yesterday, 11:50 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: 44,179
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Its the CSS your best bet is to extract the actual images files into a CBZ and convert that. Fixed layout is not actually supported in calibre.
kovidgoyal is online now   Reply With Quote
Old Today, 12:23 AM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 38,158
Karma: 152037714
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what it may be worth, I took your .azw3 and unpacked it to epub with the KindleUnpack plugin. I then looked at your cover and page1 files and modified the code to display them full page with an svg wrapper. This may be of some help to you if you don't want to use a CBZ file. Basically, the only change needed between the files was the name of image file to display as long as all the image files have the same dimension (1279x1920 pixels for your test images.) so I used a regex search/replace to do the dirty work.

The '<meta name="primary-writing-mode" content="horizontal-rl"/>' was preserved so the epub reads from back to front. The 'rightspread" and "leftspread" were not preserved so a single image per page.
Attached Files
File Type: epub Test - Tom S.epub (730.6 KB, 4 views)
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Windows] Viewer for fixed-layout AZW3? ownedbycats Reading and Management 4 01-04-2023 09:07 AM
Converting fixed-layout AZW3 tomsem Conversion 2 12-17-2022 02:05 PM
CBR images converted to greyscale in EPUB/AZW3 converted files csscribus Conversion 5 12-27-2020 07:59 PM
KindleUnpack - Fixed Layout - two pages per spread dtx490 ePub 13 08-07-2020 12:58 AM
Converted AZW3 ebook to PDF with some layout issues neyet Conversion 11 02-20-2020 04:22 PM


All times are GMT -4. The time now is 03:20 AM.


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