Skip to content
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

[Feature Request] Add option for the insertion of a single blank page to correct alignment of two-page spreads #640

Closed
senecaFallsConvention opened this issue Dec 10, 2023 · 27 comments · Fixed by #561
Labels
Enhancement New feature or request good first issue Good for newcomers GUI

Comments

@senecaFallsConvention
Copy link

I don't know if it's something inherent to Kobo devices or to the conversion process, but the first page of any file created with KCC, at least when viewed on a Kobo Libra 2, takes up two pages. This is problematic when the images in the archive were already arranged so that two-page spreads would properly fall on two pages. This causes the images to fall out of alignment and all two-page spreads to be split between one page and the next. It's possible to remedy this by extracting the archive and duplicating two pages near the beginning so the alignment is fixed, but that takes significantly more time (especially when converting numerous archives) than a checkbox option that would insert a single blank page and fix the alignment during the conversion process, no extraction necessary.

If, as I think, this is a quirk of Kobo devices, an option such as this could save many people a lot of time.

@axu2
Copy link
Collaborator

axu2 commented Dec 10, 2023

Are you able to run pull request code? https://github.com/ciromattia/kcc/wiki/Installation#install-from-source

This would have to be an option, on Kindles the duplicated page is necessary for double page spread alignment.

@senecaFallsConvention
Copy link
Author

Are you able to run pull request code? https://github.com/ciromattia/kcc/wiki/Installation#install-from-source

This would have to be an option, on Kindles the duplicated page is necessary for double page spread alignment.

I run the flatpak GUI version of KCC and I'd rather not swap to using a source-compiled CLI version.

I understand that this would need to be an option, which I specified in the original request. As an option, it could only benefit the people who need it and inconvenience no one.

@axu2 axu2 added Enhancement New feature or request GUI good first issue Good for newcomers labels Dec 11, 2023
@VampiroMedicado
Copy link
Contributor

Hi @senecaFallsConvention, could you provide a picture to illustrate the issue?

I suspect that the cover page, which is displayed during book selection, and the first page of the book are identical. On your Kobo Libra 2, it seems both pages are shown simultaneously.

My preferred choice for a workaround to this issue would be to skip the first page. Removing the cover file could hinder your ability to search and easily distinguish between different books. Additionally, adding a blank page would not add any meaningful value. 🤔

@axu2 axu2 removed the good first issue Good for newcomers label Jan 2, 2024
@VampiroMedicado
Copy link
Contributor

VampiroMedicado commented Jan 3, 2024

Hi @senecaFallsConvention I've created a branch with a quick and dirty fix.

Check if it works for your use case.

Branch: https://github.com/VampiroMedicado/kcc/tree/skip-first-page

https://github.com/ciromattia/kcc/wiki/Installation#install-from-source

The changes consist of the removal from both disk and the reference path of kcc-0000.* the temp name that KCC uses for the first page on a chapter, and now the chapter cover file now has priority so that it's fullfilled before it gets deleted.

@axu2
Copy link
Collaborator

axu2 commented Jan 4, 2024

I just tried your branch on my Kindle just for confirmation it opens fine
Previously, my files would be aligned when reading in landscape. (rotate and split option)
With your branch, alignment is lost.

I imagine it works fine for the Kobo case though.

I DO think that de-duping the cover is better than adding a blank page. This would also fix the "unsupported directory structure" bug when the cover is not in a chapter folder.

@peiskios
Copy link

peiskios commented Jan 7, 2024

I don't know if it's something inherent to Kobo devices or to the conversion process, but the first page of any file created with KCC, at least when viewed on a Kobo Libra 2, takes up two pages. This is problematic when the images in the archive were already arranged so that two-page spreads would properly fall on two pages. This causes the images to fall out of alignment and all two-page spreads to be split between one page and the next. It's possible to remedy this by extracting the archive and duplicating two pages near the beginning so the alignment is fixed, but that takes significantly more time (especially when converting numerous archives) than a checkbox option that would insert a single blank page and fix the alignment during the conversion process, no extraction necessary.

If, as I think, this is a quirk of Kobo devices, an option such as this could save many people a lot of time.

I'm having the same issue where the wrong pages are being matched up but I don't understand how you fixed it. how do I extract the archive? is this something I can fix with calibre? I'm really new to all this

@axu2
Copy link
Collaborator

axu2 commented Jan 7, 2024

Right click the cbz in windows, 7zip, extract to /. Then duplicate the cover page. Then drag the whole folder into kcc. @peiskios

Or install from source following the link.

You're the second kobo person to bring this up, I'm tempted to just make this default kobo/other behavior.

@VampiroMedicado
Copy link
Contributor

@peiskios if you have time try my fix for EPUBs specifically.

#640 (comment)

@axu2 axu2 added the Kobo Kobo device label Jan 8, 2024
@peiskios
Copy link

peiskios commented Jan 8, 2024

im not sure if I did it right, but the fix that removes page 0000 didn't work for me.

extracting the contents of the cbz file into a folder and duplicating the cover page worked! Is there a way to make it a blank page instead? Would I just make a "blank" jpeg of the same dimensions/resolution as one of the pages and name it the same as the cover page copy? Not a huge deal if I'm stuck with two cover pages at the beginning, but I thought I'd ask in case it is possible

@axu2
Copy link
Collaborator

axu2 commented Jan 8, 2024

@peiskios In what way did it not work? Make sure you are on the correct branch in GitHub Desktop.

And yes, you could just use a blank page with the same name.

@peiskios
Copy link

peiskios commented Jan 8, 2024

@peiskios In what way did it not work? Make sure you are on the correct branch in GitHub Desktop.

And yes, you could just use a blank page with the same name.

it just didn't do anything and looked the same. duplicating the first page is simpler for me so ill just stick with that until there's an easier/faster fix. thanks for your help!

@axu2
Copy link
Collaborator

axu2 commented Jan 8, 2024

@peiskios Can you confirm on GitHub Desktop you are on the right branch? skip-first-page The branch should go further and de-dupe the cover with no manual edits.

image

@PrinceSeven
Copy link

I would also love for this to become a feature inside the KCC GUI, doing it by hand is very tedious.
However, while adding or removing a page would indeed fix the problem for a book, it wouldn't fix it for multiple files combined into a single epub.
For example, if you own multiple chapters of a single volume and want to combine them into one, if some chapters have an odd number of pages, it would throw off the order again due to Kobo ignoring any indicators that one page should be displayed alone.

This is not an issue on Kindle devices as far as I've tested.

@VampiroMedicado
Copy link
Contributor

VampiroMedicado commented Jan 10, 2024

I would also love for this to become a feature inside the KCC GUI, doing it by hand is very tedious. However, while adding or removing a page would indeed fix the problem for a book, it wouldn't fix it for multiple files combined into a single epub. For example, if you own multiple chapters of a single volume and want to combine them into one, if some chapters have an odd number of pages, it would throw off the order again due to Kobo ignoring any indicators that one page should be displayed alone.

This is not an issue on Kindle devices as far as I've tested.

If you have a Kobo, could you try the branch on the following comment; #640 (comment)

Could you provide us an example? Check also the following comment: #640 (comment) if it explains the issue.

I have two kindles, but not a Kobo to check this 😅

@PrinceSeven
Copy link

If you have a Kobo, could you try the branch on the following comment; #640 (comment)

Could you provide us an example? Check also the following comment: #640 (comment) if it explains the issue.

I have two kindles, but not a Kobo to check this 😅

If you were to quickly build it into the GUI I'd test it out, as I'm really terrible at using from source and other similar applications.

As for the second thing I was talking about, I don't think it's really relevant in the end, simply that combining chapters into a single epub can wield to unsatisfying results.

@VampiroMedicado
Copy link
Contributor

VampiroMedicado commented Jan 10, 2024

If you have a Kobo, could you try the branch on the following comment; #640 (comment)
Could you provide us an example? Check also the following comment: #640 (comment) if it explains the issue.
I have two kindles, but not a Kobo to check this 😅

If you were to quickly build it into the GUI I'd test it out, as I'm really terrible at using from source and other similar applications.

As for the second thing I was talking about, I don't think it's really relevant in the end, simply that combining chapters into a single epub can wield to unsatisfying results.

It's always on. There's no checkbox at the moment, just a quick fix to try the idea.

I guess you meant an executable: https://github.com/VampiroMedicado/kcc/actions/runs/7480624692.

Just run it and try to make an epub.

imagen

On the left the first page which is used as a cover and on the right the first page on the EPUB (page 2).

@PrinceSeven
Copy link

The download link doesn't work, Mediafire deems it as a dangerous file, might want to zip it first to counter this

@VampiroMedicado
Copy link
Contributor

VampiroMedicado commented Jan 10, 2024

The download link doesn't work, Mediafire deems it as a dangerous file, might want to zip it first to counter this

Good idea, https://github.com/VampiroMedicado/kcc/actions/runs/7480624692

Edit by @axu2 .

@peiskios Does this exe work for your use case? Also, how does Kobo Store manga handle covers compared to KCC?

@axu2
Copy link
Collaborator

axu2 commented Jan 10, 2024

Please remove your media fire links and instead use GitHub Actions on your fork to generate exe. @VampiroMedicado

@VampiroMedicado
Copy link
Contributor

Please remove your media fire links and instead use GitHub Actions on your fork to generate exe. @VampiroMedicado

Ok, will do.

@PrinceSeven
Copy link

I've tested it : https://imgur.com/a/ktoGvDd
Can confirm it works, although the result is that upon opening the book, the first page displayed alone is not the cover but page 001 instead, whichI think is a shame because the only ways to see the full cover art ends up being to put the Kobo in sleep mode, where it will display the cover art of what you are currently reading as a lock screen.

Still, this is a big improvement as it does work (as can be seen on the third image in my imgur link which is a double spread), thank you.

@axu2
Copy link
Collaborator

axu2 commented Jan 10, 2024

@PrinceSeven Does Kobo store manga start on the cover instead of page 1? I only have Kindle. I can page back from page 1 to get to cover.

@PrinceSeven
Copy link

cover.jpg will display as the lock screen and cover art when browsing, but Page 1 (so the first page shown individually from the others) will be the first image in the epub (aside from the cover), so in this case 001.jpg (000.jpg which KCC deleted was a duplicate of the cover art).

@PrinceSeven
Copy link

My ideal solution personally would be to add a blank image as the second image in the Epub. That way the cover art cover art would remain the first pic you see when you open the ebook, while still reordering properly the pages.

@VampiroMedicado
Copy link
Contributor

cover.jpg will display as the lock screen and cover art when browsing, but Page 1 (so the first page shown individually from the others) will be the first image in the epub (aside from the cover), so in this case 001.jpg (000.jpg which KCC deleted was a duplicate of the cover art).

I see, if you want to view the cover art, that might be an issue. As @axu2 mentioned, on Kindle, we can go back and check the cover art, but it always starts from the first page.

Personally, I don't care a lot about the cover art besides knowing what I'm reading when it's locked, but we could provide both options for people who do care.

  1. Add a 1x1 blank PNG as page 0001.
  2. Remove page 0000 after cover.jpg is created.

What do you think, @axu2?

I'll check if EPUB has any features to work like the Kindle does and get back to you. Thanks @PrinceSeven for the help!

@axu2
Copy link
Collaborator

axu2 commented Jan 10, 2024

@PrinceSeven how does Kobo Store manga behave?

@VampiroMedicado
Copy link
Contributor

VampiroMedicado commented Jan 10, 2024

To add more information.

https://github.com/kobolabs/epub-spec#cover-images

Covers should also be listed in the OPF metadata section. The metadata indicates the cover by pointing to the ID of the cover file in the manifest. Kobo uses this tag to identify which image to display as a thumbnail within user's libraries across platforms.

Ex. OPF metadata:

<meta name="cover" content="cover-image"/>

Manifest item listing:

<item href="cover.jpg" id="cover-image" media-type="image/jpeg"/>

Cover images must be contained in their own XHTML files.

content.opf

KCC

...
<meta name="cover" content="cover"/>
...
<item id="cover" href="Images/cover.jpg" media-type="image/jpeg" properties="cover-image"/>
...

I see a different content attribute that might or might not affect the intended behavior, and we do not have a cover.xhtml file. If we get our hands on a Kobo Store epub file we might be able to confirm this.

@axu2 axu2 added good first issue Good for newcomers and removed Kobo Kobo device labels Mar 6, 2024
@axu2 axu2 closed this as completed in #561 May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request good first issue Good for newcomers GUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants