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

Bugfix: handle SVGs containing images embedded as data URIs #534

Merged
merged 1 commit into from
Nov 16, 2017

Conversation

martijnthe
Copy link

The dict returned from open_data_url does not contain a file_obj key. This line was throwing a key error before.
Fix: avoid accessing the non-existent key.

Fixes #529.

The `dict` returned from `open_data_url` does not contain a `file_obj` key. This line was throwing a key error before.
Fix: avoid accessing the non-existent key.

Fixes Kozea#529.
@martijnthe
Copy link
Author

@liZe I'm sorry for not adding a unit test.
I had trouble getting them to run locally properly.

@martijnthe
Copy link
Author

hrmm.. the failed unit test looks unrelated to the change I made, it also only failed on the macOS build...

=================================== FAILURES ===================================
______________________________ test_overflow_wrap ______________________________
    @assert_no_logs
    def test_overflow_wrap():
        def get_lines(wrap, text):
            page, = parse('''
                <style>
                    body {width: 80px; overflow: hidden; font-family: ahem; }
                    span {overflow-wrap: %s; white-space: normal; }
                </style>
                <body style="hyphens: auto;" lang="en">
                    <span>%s
            ''' % (wrap, text))
            html, = page.children
            body, = html.children
            body_lines = []
            for line in body.children:
                box, = line.children
                textBox, = box.children
                body_lines.append(textBox.text)
            return body_lines
    
        # break-word
        lines = get_lines('break-word', 'aaaaaaaa')
>       assert len(lines) > 1
E       AssertionError: assert 1 > 1
E        +  where 1 = len(['aaaaaaaa'])
weasyprint/tests/test_text.py:581: AssertionError
============== 1 failed, 303 passed, 1 xfailed in 100.05 seconds ===============

Any ideas @liZe?

@liZe
Copy link
Member

liZe commented Nov 16, 2017

Thank you for this pull request!

hrmm.. the failed unit test looks unrelated to the change I made, it also only failed on the macOS build...

Yes, it's a bug in Pango 1.40.13 fixed in Pango 1.40.14, we can safely ignore the problem.

@liZe liZe merged commit bd5e58f into Kozea:master Nov 16, 2017
@liZe liZe added this to the v0.42 milestone Nov 16, 2017
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.

3 participants