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

PDF cover got inserted into 2nd page instead of first page. #686

Open
shihong5858 opened this issue Apr 15, 2024 · 6 comments
Open

PDF cover got inserted into 2nd page instead of first page. #686

shihong5858 opened this issue Apr 15, 2024 · 6 comments

Comments

@shihong5858
Copy link

shihong5858 commented Apr 15, 2024

Describe the bug
When converting a pdf manga into a CBZ file, the cover on the first page got inserted into 2nd page in CBZ file.

To Reproduce

  1. Using kcc.exe or command-line kcc-c2e.exe.
  2. Run this command or setting on the GUI:
    E:\kindle-bk\kcc-c2e.exe -p KoC -f CBZ -mus --cropping 1 --croppingpower 1 --gamma 1.35 E:\input\test2.pdf -o E:\output\test2.cbz
  3. The generated PDF got the cover inserted on the 2nd page.

Expected behavior
The generated PDF got the cover inserted on the 1st page, like in the original PDF file.

Sample Files

CBZ
PDF

Desktop (please complete the following information):

  • Windows 10
  • Kobo

Additional context
Add any other context about the problem here.

@axu2
Copy link
Collaborator

axu2 commented Apr 16, 2024

@shihong5858 Unfortunately, that is just the order of the images in the bytes of the pdf. You can verify it by running a

winget install --id=ArtifexSoftware.mutool  -e
mutool extract test.pdf 

image

Logic to follow the actual page order of the pdf could be possible, but considering how mutool doesn't account for it I'm not sure how to do it.

You could manually rename the first page, in pdfs I often find weird order issues with the first page.

@shihong5858
Copy link
Author

Thanks for the explanation.

The file was converted by Calibre command-line tool from a mobi file. The ordering was correct in the original mobi file. I guess I have to see if there's any configure I can tweak on the Calibre side then.

@axu2
Copy link
Collaborator

axu2 commented Apr 16, 2024

@shihong5858 can't you use calibre to convert mobi to cbz/zip?

@shihong5858
Copy link
Author

@axu2 I've tried. Calibre cannot directly convert the file into cbz file (which is my target format), and I used to use zip as the intermediate format before passing to kcc.
However when converting to zip files, I found some of the mobi files had put the cover page as a random page and they use metadata in .ncx/.opf to define the cover information. Therefore I tried to convert it into pdf (so it reads the metadata and put the cover as the first page) but found such issue.

@axu2
Copy link
Collaborator

axu2 commented Apr 16, 2024

Ideally you would find a source that isn't mobi

@shihong5858
Copy link
Author

Yea... but the purpose of my script is to help ppl convert common format into kobo friendly format, so I cannot have a choice :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants