Skip to content

Commit

Permalink
Fix SVG not working in some viewers
Browse files Browse the repository at this point in the history
This is because of the spurious `ns0:` XML namespace prefix, see
python/cpython#113425.
  • Loading branch information
dechamps committed Dec 23, 2023
1 parent af76cd4 commit 2262c02
Show file tree
Hide file tree
Showing 12 changed files with 55,481 additions and 55,474 deletions.
7 changes: 7 additions & 0 deletions videojitter_test/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ def prettify_json(path):


def prettify_xml(path):
# Work around https://github.com/python/cpython/issues/113425 otherwise the
# resulting SVG does not work in e.g. VS Code, GitHub file browser. Note the simpler
# `write(default_namespace=)` workaround doesn't work because it triggers a
# "cannot use non-qualified names with default_namespace option" error, so we have
# to fall back to register_namespace() (which, sadly, involves mutable global
# state... sigh)
ET.register_namespace("", "http://www.w3.org/2000/svg")
element_tree = ET.parse(path)
ET.indent(element_tree)
element_tree.write(path, encoding="utf-8", short_empty_elements=False)
Expand Down
7,950 changes: 3,975 additions & 3,975 deletions videojitter_test/cases/asusvlc_60p_at_240hz/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,626 changes: 1,813 additions & 1,813 deletions videojitter_test/cases/asuswmp_23p_at_240hz/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29,540 changes: 14,770 additions & 14,770 deletions videojitter_test/cases/asuswmp_240p_at_240hz/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29,504 changes: 14,752 additions & 14,752 deletions videojitter_test/cases/asuswmp_240p_at_240hz/test_output/zoomed_report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,620 changes: 1,810 additions & 1,810 deletions videojitter_test/cases/evr_23p_at_59hz/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,572 changes: 1,786 additions & 1,786 deletions videojitter_test/cases/evr_23p_at_59hz/test_output/zoomed_report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15,126 changes: 7,563 additions & 7,563 deletions videojitter_test/cases/lg_119p_lowbrightness/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,620 changes: 1,810 additions & 1,810 deletions videojitter_test/cases/lg_23p/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,572 changes: 1,786 additions & 1,786 deletions videojitter_test/cases/lg_23p/test_output/zoomed_report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,620 changes: 1,810 additions & 1,810 deletions videojitter_test/cases/madvr_23p_at_119hz/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7,198 changes: 3,599 additions & 3,599 deletions videojitter_test/cases/pixel5vlc_59p/test_output/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2262c02

Please sign in to comment.