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

New covergen tool #44

Merged
merged 18 commits into from
Nov 25, 2019
Merged

New covergen tool #44

merged 18 commits into from
Nov 25, 2019

Conversation

pgaskin
Copy link
Owner

@pgaskin pgaskin commented Oct 19, 2019

@pgaskin pgaskin self-assigned this Oct 19, 2019
@pgaskin
Copy link
Owner Author

pgaskin commented Oct 19, 2019

TODO:

@pgaskin pgaskin marked this pull request as ready for review October 19, 2019 15:52
@pgaskin
Copy link
Owner Author

pgaskin commented Oct 19, 2019

I've tested this, and it works well on my Mini and Aura2v1. For epubs, it now shows the actual cover instead of a screenshot of the first page with a black border. For kepubs, it now consistently shows the cover image, even for books without the cover-image property or the meta tag. There also isn't an extra black border around the covers anymore either, and the cover fills the space properly. I've checked it on the view details, the home screen, the sleep screen, the library list, and the library grid.

To regenerate the covers from nothing, it seems to be just under twice as fast as the built-in cover generation.

P.S. One slightly unrelated thing I noticed is that nickel seems to like segfaulting if you delete .kobo-images from under it and have PDF books.

This still needs to be tested on Windows to make sure the path handling is correct. I'd also appreciate it if someone with a Libra and a wide variety of books could test this out (use the --regenerate option) to make sure it works.

@pgaskin
Copy link
Owner Author

pgaskin commented Oct 19, 2019

I've added an option to set the aspect ratio of the covers. I personally like 1.5, but 1.6 fills the space on the home screen better (but it looks too stretched to me).

covergen/covergen.go Outdated Show resolved Hide resolved
covergen/covergen.go Outdated Show resolved Hide resolved
@shermp
Copy link

shermp commented Oct 19, 2019

Do you have any plans to support PNG and/or SVG (input) cover images?

@pgaskin
Copy link
Owner Author

pgaskin commented Oct 19, 2019

Yes, PNG and GIF are supported right now (in terms of the format itself), but for the color encoding, I'll need to add conversion so rez can use it. I'm not planning to add SVG at the moment, though.

@shermp
Copy link

shermp commented Oct 19, 2019

Ah yes. See that now.

Was looking at the resize code, which only deals with YCbCr colourspace.

@shermp
Copy link

shermp commented Oct 19, 2019

BTW: I'm happy for you to re-license any of the image code from KU if you wish. By this point, it's mostly all your code anyway :p

Main reason for using AGPL3 in KU is because of FBInk. And FBInk has been re-licensed to plain GPL now, so I can probably change KU.

@pgaskin
Copy link
Owner Author

pgaskin commented Oct 19, 2019

Was looking at the resize code, which only deals with YCbCr colourspace.

I was considering switching resize libraries, as all are pretty fast on x86, but then I realized some of my scripts run kepubify and seriesmeta on the Kobo itself. I also don't want to pull in too many dependencies.

BTW: I'm happy for you to re-license any of the image code from KU if you wish. By this point, it's mostly all your code anyway :p

Yes, at first I did pull it from KU, but I realized since I was re-doing the research again, I might as well write it from scratch.

@pgaskin
Copy link
Owner Author

pgaskin commented Nov 25, 2019

I've just tested this while setting up my Clara, and it worked perfectly and resulted in a huge performance benefit to looking through the library. I'm going to merge it and make a release once I merge the koboutils PR.

@pgaskin pgaskin merged commit fb896df into master Nov 25, 2019
@pgaskin pgaskin deleted the covergen branch June 11, 2021 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants