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

Added Calibre HTML output cbz support #723

Closed
wants to merge 2 commits into from

Conversation

Morialkar
Copy link

Ensured the check for Calibre HTML export is non destructive and won't impact the rest of the code.

I had a bunch of CBZ that were basically wrapping the Calibre HTML export in a cbz file. Added support to extract the images and place the cover at the top to then ensure proper function of the rest of the conversion process. If it's not a calibre HTML format (contains only an HTML file with a random identifier and a folder called RANDOMID_files) this update will not touch anything.

Ensured the check for CalibreHTML export is non destructive and won't impact the rest of the code
@axu2
Copy link
Collaborator

axu2 commented Jul 28, 2024

(I am not familiar with Calibre.)

Are you saying that cbz files generated from calibre work weird in kcc?

What was the original format before calibre converted to cbz?

@Morialkar
Copy link
Author

I downloaded a bunch of CBZ (that I did not personally generate) that didn't work with KCC and once opened had this directory structure.
CleanShot 2024-07-28 at 19 12 45

So I added support for it. I assume it's Calibre related due to the calibreHtmlOutBasicCss file

@Morialkar
Copy link
Author

Morialkar commented Jul 28, 2024

Also I'm dealing with a small bug locally but I added another catch to handle another set that didn't include the "OPS" folder and had the images folder in the root _files directory

@axu2
Copy link
Collaborator

axu2 commented Jul 28, 2024

Is this a specific case of this general issue?

Aka:

Vol1/
--cover.jpg
--ch1/
----000.jpg
----001.jpg
--ch2/
----010.jpg

....

@Morialkar
Copy link
Author

I don't think that's related, since the directory structure here is more:

Vol1/
--4iu32i_files/
----cover.jpeg
----OPS/
------images/
--------001.jpg
--------002.jpg
--4iu32i.html

Where I turn that into

Vol1/
--000.jpg
--001.jpg
--002.jpg

for proper processing.

But I can work in a fix to handle the cover.jpeg outside the first chapter in my logic to make the PR more valuable if you want, no trouble for me :)

@axu2
Copy link
Collaborator

axu2 commented Aug 9, 2024

I don't know about this PR, there's duplicated code. (Like OPS vs noOPS)

And we don't know what process creates files in this structure, because these are not normal CBZ files. These look like EPUB files renamed to CBZ. Since you didn't personally generate them.

I feel that it would be more useful to create a function that

  1. Checks if the files directory structure is compatible with KCC. https://github.com/ciromattia/kcc/wiki/Automatic-output-splitting
  2. If it's not, flatten the file structure. And give a info message in the GUI that a flattening occured.
  3. Remove unsupported directory structure warning.

This way, it would be more generic, because you may run into another slightly different file structure like OPS vs noOPS since we don't know what process created your files.

Edit: closed due to inactivity, reopen as needed.

@axu2 axu2 closed this Aug 28, 2024
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

Successfully merging this pull request may close these issues.

2 participants