-
-
Notifications
You must be signed in to change notification settings - Fork 418
Fix: Add thumbnail generation for .cbr and .cbz files #1052
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
base: main
Are you sure you want to change the base?
Conversation
Just wanna let all of you know that for cbz files in the comic/manga spaces it's common to find at the root of the archive a https://github.com/anansi-project/comicinfo |
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.
Thank you for submitting this, but I'm noticing a lot of fundamental issues with this one that suggests to me that it was not tested or that the new code was unknowingly overshadowed by the existing functionality inside the eBook rendering step (which includes .cbz but not .cbr).
If this PR was made in good faith, I recommend taking a look at the CONTRIBUTING.md page and making sure that this code is in a functional state. I've made a few surface level comments on some of the code, and I see you've already fixed the broken import.
# Comic Book Archives ========================================= | ||
elif ext in {".cbr", ".cbz"}: | ||
image = self._render_comic_archive(str(_filepath), QSize(*base_size)) |
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.
Because this check is being made after the EBOOK_TYPES
check which already includes these files, this code is not being ran.
if not pixmap.loadFromData(image_data): | ||
return None | ||
|
||
return self.scale_pixmap(pixmap, size) |
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.
This is the incorrect return type. The ThumbRenderer expects a PIL type Image object, not a QPixmap. Also, this method does not exist.
Summary
Closes #1051
This PR adds thumbnail generation for
.cbr
and.cbz
files. The new logic reads the archive and uses the first internal image as the cover preview, fixing the bug where thumbnails were incorrect or missing.This change adds the
rarfile
dependency topyproject.toml
for.cbr
support.Tasks Completed
Implemented a new rendering path for comic book archives in
thumb_renderer.py
.Added the
rarfile
dependency to support.cbr
files.Platforms Tested:
.cbr
and.cbz
thumbnails now render correctly)