-
-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double Page (No Cover) now keep opposite flow of Double Page fixing Split Double Spreads #1236
base: master
Are you sure you want to change the base?
Conversation
… both have one empty, when they should have been together
@@ -9,40 +9,36 @@ export function buildSpreads(pages: PageDtoWithUrl[], pageLayout: PagedReaderLay | |||
if (pageLayout !== PagedReaderLayout.SINGLE_PAGE) { | |||
const spreads = [] as PageDtoWithUrl[][] | |||
const pagesClone = cloneDeep(pages) | |||
let lastPages = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed lastPages, and the chunk handling it below as the loop part of the algorithm handles getting the last image in place
@@ -95,23 +95,20 @@ describe('Double Pages', () => { | |||
] as PageDtoWithUrl[] | |||
|
|||
const spreads = buildSpreads(pages, pageLayout) | |||
|
|||
expect(spreads.length).toEqual(4) | |||
// Expecting [E, 1], [2, 3], [4, 5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked about this in more details with an example in the PR original post
spreads.push([p2]) | ||
} else { | ||
spreads.push([p, p2]) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically all the same logic, just if it's DBNC layout, then just push a empty page after the previous page if and only if it was a landscape page. This guarantees the layouts will be opposite if landscape pages existed, which is what throws off the flow.
I kind of have a related issue and I am not completely sure this would solve it adequately. In physical books the first page of the story is supposed to be on the right (Left in Manga and other right to left reading convention) - with a few exceptions (Asterix, le domaine des dieux (Mansion of the gods) for example). In physical books this is usually achieved by having a blank page at the beginning of the book as part of the front matter, this page is often missing in digital copies. |
Hi Gotson 👋 Long time admirer & user, first time contributor - let me know if there's anything I can do to have this move forward, thanks.
Use-Case: Attempting to solve #803. Users who read with double pages want to easily view double spreads where both pages are shown together. In some cases, double spreads are shifted so that only one page of the double spread is visible. The aim is to provide a feature that allows users to read pages together as double spreads.
Double Pages & Double Pages (no cover): This enables users to switch between these layouts to ensure that double spreads are always displayed together. By injecting an empty page after a Landscape page in DP NC layout, Split Double Spreads (SDS) are displayed correctly as double spreads, and users can easily switch to the appropriate layout easily ("D" hotkey).
Example:
A Landscape page can throw things off - like this inner leaflet scan after the double cover/back landscape pages:
Then the next page was this:
Original Algorithm:
Both layouts could be in lockstep after a landscape page disrupted the 2 page stepping
This resulted in the flow through the whole volume being off by one, and no way to see it correctly in komga besides manually readjusting potentially thousands of volumes and pages manually:
This PR, Now you can switch to the alternate layout if it matches you book:
Now you can switch to the right flow is as the author intended:
The additional issue of where pages could do:
DP: [E, 1], [2, 3], [4, E], [5, E]
has now been changed to always just show the next pages next to each other:
[E, 1], [2, 3], [4, 5]
If the last page was a Split Double Spread, then there was no way to see the two pages together previously.
I think this was done under the assumption that the last page was always the back cover, but issues of comics online often don't have this given they haven't been compiled into a volume (which may add additional pages between chapters or an ending cover)
Example of Original Algorithm
This PR:
The last additional issue brought up in 803, was resolved a year or two before (not adding an empty page if the first page was landscape). This should resolve the concerns from 803 completely.