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

Images in CSS are not downloaded #157

Open
justinplus opened this issue Nov 26, 2019 · 4 comments
Open

Images in CSS are not downloaded #157

justinplus opened this issue Nov 26, 2019 · 4 comments
Labels
bug help wanted need more info Please provide more info to address the issue

Comments

@justinplus
Copy link

Hi,

It seems that images in the CSS are not downloaded, like

:after{content:url(css_assets/titlepage_footer_ebook.png);

Not familiar with Python, but I would try to fix this.

Thank you,
Justin

@diegorodriguezv
Copy link

Hi @justinplus.
Do you have an ebook id that triggers this problem? So that we can reproduce, fix and test?
Thanks.

@maprangzth
Copy link

@lorenzodifuccia lorenzodifuccia added bug help wanted need more info Please provide more info to address the issue labels Jul 21, 2020
@MuhammedElGanzory
Copy link

MuhammedElGanzory commented Jan 20, 2021

Hi @justinplus.
Do you have an ebook id that triggers this problem? So that we can reproduce, fix and test?
Thanks.

The problem also happens with this book id, 9780763778828
The ebook has no content after coversion
Hope it works later..

@lorenzodifuccia lorenzodifuccia added this to the Improvement 0x01 milestone Jan 4, 2023
@bhattumang7
Copy link

The other library used does not correctly parse the files when there are mistakes in the CSS file. Here is something that will work. Thoughts?

   stylesheet = cssutils.parseFile(css_file)
            image_references = []
            for rule in stylesheet:
                if rule.type == cssutils.css.CSSRule.STYLE_RULE:
                    for declaration in rule.style:
                        if declaration.name == 'background-image':
                      # Use regular expression to match url( and capture everything within parentheses
                            match = re.search(r'url\(([^)]+)\)', declaration.value)
                            if match:
                                image_references.append(match.group(1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted need more info Please provide more info to address the issue
Projects
None yet
Development

No branches or pull requests

6 participants