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

feat: add ePub thumbnail support (port #387) #539

Merged
merged 5 commits into from
Oct 17, 2024
Merged

feat: add ePub thumbnail support (port #387) #539

merged 5 commits into from
Oct 17, 2024

Conversation

CyanVoxel
Copy link
Member

This PR is a port of #387 which previously targeted thumbnails/Alpha-v9.4 to main (aka v9.5x).

This adds thumbnail/preview support for ePub files.

Co-Authored-By: Jorge Rui Da Silva Barrios <29062316+jorgerui@users.noreply.github.com>
@CyanVoxel CyanVoxel added Type: UI/UX User interface and/or user experience Priority: Low Doesn't require immediate attention Status: Review Needed A review of this is needed labels Oct 10, 2024
@CyanVoxel CyanVoxel added this to the Alpha v9.5 (Post-SQL) milestone Oct 10, 2024
@CyanVoxel CyanVoxel added the Type: Enhancement New feature or request label Oct 10, 2024
tr = ThumbRenderer()
cover_image: Image.Image = tr._epub_cover(file_path)

assert cover_image is not None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to make a test which will actually check the final result as well similarly as done here for pdf:

b1bae1f

Co-Authored-By: yed <yedpodtrzitko@users.noreply.github.com>
@CyanVoxel
Copy link
Member Author

Implemented the improved test 👍 I'll do the same for the other PRs as well.

Also we're having unrelated issues with the pytest workflow, so these tests are going to fail here regardless until that's resolved

@yedpodtrzitko
Copy link
Collaborator

nit: the .epub file has almost 4MB, that feels like an overkill a bit. .epub is just .zip file, so maybe its content can be gutted a bit? The embedded fonts are not really necessary, and the image itself can be shrinked a bit too.

@CyanVoxel CyanVoxel merged commit d3c3e63 into main Oct 17, 2024
10 checks passed
@CyanVoxel CyanVoxel removed Priority: Low Doesn't require immediate attention Status: Review Needed A review of this is needed labels Oct 17, 2024
@CyanVoxel CyanVoxel deleted the epub branch October 17, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request Type: UI/UX User interface and/or user experience
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants