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

Added image embedding support for epub #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

IdanDor
Copy link
Contributor

@IdanDor IdanDor commented Nov 4, 2022

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).

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).
@kemayo
Copy link
Owner

kemayo commented Nov 17, 2022

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?

@IdanDor
Copy link
Contributor Author

IdanDor commented Nov 17, 2022

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
Copy link
Contributor Author

IdanDor commented Nov 17, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants