File indexing completed on 2025-01-19 03:59:52

0001 from .base import importer
0002 from ..parsers.baseporter import ExtraOption
0003 from ..parsers.svg import parse_svg_file
0004 from ..parsers.tgs import open_maybe_gzipped
0005 
0006 
0007 @importer("SVG", ["svg", "svgz"], [
0008     ExtraOption(
0009         "layer_frames", type=int, default=0,
0010         help="If greater than 0, treats every layer in the SVG as a different animation frame,\n"
0011         "greater values increase the time each frames lasts for."),
0012     ExtraOption("n_frames", type=int, default=60),
0013     ExtraOption("framerate", type=int, default=60),
0014 ])
0015 def import_svg(file, *a, **kw):
0016     return open_maybe_gzipped(file, lambda svgfile: parse_svg_file(svgfile, *a, **kw))