Align Double Pages & Double Pages (no cover) to always be opposite of each other #1591
kanjieater
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe your suggested feature
Problem Statement
So to summarize the use-case: As a user who reads with double pages, I want to be able to easily shift the pages to show the double spread as a double spread. Sometimes my comics double spreads are shifted so only one page of the double spread shows, and I would like to be able to read the pages together.
The original issue was also described here, though this would be a new feature not a bug it would seem given that this is new functionality: #796
Approach
After trying this out on a few different readers there are a couple of different solutions that could work, but I think the cleanest to implement and best user experience would be to use the Double Pages & Double Pages (no cover) to keep a sequence of 2 pages (spreads) that is opposite of each other. So if you ever found your double pages to be off, you switch to the other one with a simple "D" hotkey & don't miss a beat. This is the same way it works now for comics with odd numbers of pages.
Current code
komga/komga-webui/src/functions/book-spreads.ts
Line 7 in a1e9238
So if a spreads looks like:
We can assume there is a single cover. There may be an empty page if the Cover is not landscape. Or if it is landscape we don't need the empty page
E: Empty Page
L: landscape
SDS: A split double spread (the problem here)
Num: The physical books page number
[SomeLeftPage, SomeRightPage]: the left page, and the right page in the spread
DP: Double Page Layout (this is what properly ripped and numbered books should look like)
DPNC: Double Pages (no cover) (this is what books additional content that throws off the page number will probably look like)
So the important thing here is that there should never be a single page of the spread that lands on the same side on both DPs spread:
Imagine Pages 3 & 4 are actually a split double spread:
DP: [[E, 1L], [2, 3SDS], [4SDS, 5], [6, 7]] // This one won't look as good
DPNC: [[1L], [E, 2], [3&4SDS], [5,6], [7, E]] // So you can easily switch to this one which will look good
DP: [[E, 1L], [2, 3SDS], [4SDS, 5], [6, 7]] // This one looks the same as DPNC
DPNC: [[1L], [2, 3SDS], [4SDS, 5], [6, 7]] // This one looks the same and doesn't fix the SDS
As long as the a 2 is not on the left for both it's DP & DPNC layout, there's no issue.
So what about landscape pages at random points? It's important to note that it's ok for L's to end up as the only page in the spread in both layouts. That shouldn't break the alternating flow of single pages though.
DP: [[E, 1L], [2, 3], [4L], [5, 6SDS], [7SDS, 8]] // This one won't look as good
DPNC: [[1L], [E, 2], [4L], [E, 5], [6SDS, 7SDS], [8, E]] // This will look good! Last page get's filled with an E per the current algo
So the only change on DPNC is that it needs to inject an E after any landscape page when it goes to a single page. So no empty pages before repeating landscape pages, but yes empty page when the landscape page sequence goes back to normal pages
DP: [[E, 1L], [2L], [3, 4], [5, 6SDS], [7SDS, 8]] // This one won't look as good
DPNC: [[1L], [2L], [E, 3], [4, 5], [6SDS, 7SDS], [8, E]] // This will look good! Last page get's filled with an E per the current algo
DP: [[E, 1], [2, 3], [4, 5], [6, 7], [8L], [9, E] // Same as current
DPNC: [[1, 2], [3, 4], [5, 6], [7, E], [8L], [E, 9]] // Current algo inject a E before a new L comes on the right [7, E]. Then we keep the pattern of after an L inject an E for [E, 9].
In summary the only change needed is to inject an empty page after a L for DPNC layouts.
I can open up separate issues for these, but their worth noticing as they could affect the spreads:
Additional Issue 1
Unrelated bug I've seen and uncovered while thinking through this
komga/komga-webui/src/functions/book-spreads.ts
Line 16 in a1e9238
By taking the last page, you can get into a double page situation like this:
[last page, E]
which was taken from a spreads that looked like this:
[[1,2],[3, last page]]
Resulting in this little awkward situation:
[[1, 2], [3, E], [last page, E]
Additional Issue 2
I don't think we should inject an empty page if the first page is Landscape like the current algo works:
DP: [[E, 1L], [2L], [3, 4]] // Original shows E next to L
DP Revised: [[1L], [2L], [3, 4]] // Just drop the E
DPNC: [[1L], [2L], [E, 3], [4, E]] // This one wouldn't be the ideal choice but would still exist. Yes this is intentional and not Additional Issue 1 - the alternating order must be preserved - there is a right and wrong layout choice. This is the wrong choice for this book.
Other details
No response
Acknowledgements
Beta Was this translation helpful? Give feedback.
All reactions