marianosimone / epub-thumbnailer

Script to extract the cover of an epub book and create a thumbnail for it
GNU General Public License v3.0
191 stars 29 forks source link

Can I tweak it to make better quality thumbs? #43

Closed Lew-Rockwell-Fan closed 9 months ago

Lew-Rockwell-Fan commented 9 months ago

FEATURE REQ or how-to-inquiry: I've got Caja set up to show thumbnails HUGE, but blowing these up doesn't help because they're so compressed. I tried unzipping an epub, extracting a copy of the cover jpg, converting it to a png with imagemagick's convert, and copying the png over over the corresponding one in ~/.cache/thumbnails/normal/ (which I presume this created) and that looked great. A config file where I could opt to bypass compression and just convert the jpg to a png would be great. I'm working on doing that with a bash script but if there is a setting or easy hack to tweak this to do that, I don't want to reinvent the wheel. So any hint on what I might change to accomplish that would be appreciated.

Lew-Rockwell-Fan commented 9 months ago

Having read more, I'm assuming there is no point in making thumbnails with either dimension over 256 pixels. I'm not even sure if the solution lies in how the thumbnails are created (and hence is relevant here) or which ones ("large" or "normal" subdirectories of "~/.cache/thumbnails/" or "~/.thumbnails/") gui file managers choose to show. Maybe I don't need to tweak this so much as figure out how to force a graphical file manager (I don't much care which as long as I can get at least one of them to work) to use the thumbs from the 'large' subdirectories. If the objective isn't addressable through this program, any suggestions where to look would be appreciated.

marianosimone commented 9 months ago

epub-thumbnailer just takes whatever size is passed in to it, and uses that to resize the thumbnails:

https://github.com/marianosimone/epub-thumbnailer/blob/baf1d66308290f3db1a3da352e0a6bf249beafde/src/epub.thumbnailer#L2

I think it's up to each file manager to decide where to look for thumbnails, so I'd look into reporting to Caja itself as per why it's not using the right ones.

This StackOverflow answer says that Caja just uses 128 as the size, and that might be the reason why it doesn't look good.

Lew-Rockwell-Fan commented 9 months ago

Thank you very much. Now I know where to look.