skia2/tools/svg
Tyler Denniston 96a97497b3 Update SVG asset creation to handle images
This CL updates the infra scripts used to create the CIPD asset for
SVG's corpus on gold to download and include image resources.

Summary of changes:
- Change svg_downloader.py input argument to more generic name
- Add --keep_common_prefix arg to svg_downloader.py to preserve the
  directory hierarchy for images, needed for the W3C test suite.
- Update infra SVG create.py script to download images
- Add svg_images.txt file with a list of the images we need for the W3C
  test suite already in gold.

Actually updating the corpus will happen in a separate CL.

Bug: skia:11229
Change-Id: I5fe9be35db247f577bda6040ca3694a428314d0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361516
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-28 21:00:24 +00:00
..
README.md Update SVG asset creation to handle images 2021-01-28 21:00:24 +00:00
svg_downloader.py Update SVG asset creation to handle images 2021-01-28 21:00:24 +00:00
svg_images.txt Update SVG asset creation to handle images 2021-01-28 21:00:24 +00:00
svgs_parse_only.txt Reland "Add subset of W3C test suite to SVG corpus" 2020-10-16 14:54:43 +00:00
svgs.txt Reland "Add subset of W3C test suite to SVG corpus" 2020-10-16 14:54:43 +00:00

SVG Tools

This directory contains the following-

svgs.txt

This text file contains an SVG URL per line. It is a list of the SVG files used to test rendering correctness.

svg_images.txt

This text file contains an image URL per line. It is a list of images used by the SVGs in svgs.txt.

svgs_parse_only.txt

This text file contains an SVG URL per line. It is a list of the SVG files used to exercise the SVG parsing code.

svg_downloader.py

This python script parses txt files and downloads SVGs and images into a specified directory.

The script can be run by hand: $ python svg_downloader.py --output_dir /tmp/svgs/ OR $ python svg_downloader.py --output_dir /tmp/svgs/ --input_file svgs_parse_only.txt --prefix svgparse_

If the --keep_common_prefix argument is specified, URL components after the common prefix will be preserved in the destination directory hierarchy. For example, if the input file contains URLs https://example.com/images/a.png and https://example.com/images/subdir/b.png, the downloaded files will go to output_dir/a.png and output_dir/subdir/b.png.