Bug 698875 - Text missing from the end of chapters in rendered pixmaps
Summary: Text missing from the end of chapters in rendered pixmaps
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: epub (show other bugs)
Version: master
Hardware: All All
: P4 major
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 09:23 UTC by Bastien Dejean
Modified: 2018-11-14 17:21 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Test document (4.48 KB, application/epub+zip)
2018-01-19 09:23 UTC, Bastien Dejean
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bastien Dejean 2018-01-19 09:23:48 UTC
Created attachment 14607 [details]
Test document

Steps to reproduce:

- Run `for p in 1 2; do muraster -W 1072 -H 1448 -S 46 -o output-${p}.pbm bhk.epub $p; done`.
- The generated pixmaps are identical: the end of the text is missing.

Please also notice the artifacts at the right and left page boundaries: some of the lines are *wrapping around*.

Now change `@page { margin: 0; }` to `@page { margin: 0.8em; }`, after running the first command again you'll get two pixmaps spanning the whole text (the expected result).
Comment 1 Bastien Dejean 2018-01-19 12:59:16 UTC
Another way of getting two pages is to replace `<h1></h1>` by `<h1>I</h1>` (without changing the margins).
Comment 2 Bastien Dejean 2018-01-22 07:44:14 UTC
I've looked at the code: *mupdf* relies on `ceilf(ch->html->root->h / ch->html->page_h)` to compute the number of pages inside a chapter. The problem is that `ch->html->root->h` is sometimes less than what it should be.
Comment 3 Bastien Dejean 2018-03-26 10:03:42 UTC
The main problem seems to have been fixed by 5521ff9f0c4a05c969c891a547a45094377cf780 or 4987023bc163939687c2ceed2f7b2a2503893fb7 but the *wrapping around* of the overflowing characters isn't.
Comment 4 Tor Andersson 2018-11-14 16:49:39 UTC
I can't see any artifacts...

The other issues are as you say already fixed.
Comment 5 Bastien Dejean 2018-11-14 17:21:29 UTC
At last!