leech icon indicating copy to clipboard operation
leech copied to clipboard

Added image embedding support for epub

Open IdanDor opened this issue 2 years ago • 3 comments

Specifically, added image_selector for arbitrary sites that allows selecting img tags from chapters, downloading them and embedding them within the resulting epub.

In the case of Pale, this means that the character banners and extra materials do not require an internet connection to view.

Also made the two pale.json's more consistent (pale.json now correctly includes the title of the chapters).

IdanDor avatar Nov 04 '22 14:11 IdanDor

Looks like a good basis for something I've been meaning to do for ages (see: #2 existing). I'm tempted to merge this as-is, and later tinker with it further to pull it closer into the core.

I'm curious, though -- what's the motivation for having an explicit selector for images, as opposed to just selecting every img that's contained in the extracted chapter?

kemayo avatar Nov 17 '22 04:11 kemayo

Just like you wrote in the linked issue, I thought it should something one can somehow disable. And the selector simply matches in my mind what the codebase does with every other "choice".

I do not have other positive/negative places to use this, I simply wanted this for Pale. So I do not have somewhere where a selector is better than simply selecting everything.

IdanDor avatar Nov 17 '22 04:11 IdanDor

Also, I should mention, to make this work, you might need to cleanup attribtues of the image (like I'm deleting srcset which was interfering). So if there are somehow multiple types of images in the same epub, you will need a more robust cleanup process for them. Maybe also a whitelist for image attributes should be added inside the code? (might be over engineering to add it as a json parameter).

IdanDor avatar Nov 17 '22 04:11 IdanDor