Remove more debugging stuff
This commit is contained in:
parent
04ddf53c4f
commit
61684425df
@ -12,12 +12,10 @@ def embed_svg_images(filename_in: Path, overwrite: bool = True):
|
|||||||
filename_in = Path(filename_in).resolve()
|
filename_in = Path(filename_in).resolve()
|
||||||
filename_out = f'{filename_in.with_suffix("")}.b64.svg'
|
filename_out = f'{filename_in.with_suffix("")}.b64.svg'
|
||||||
images_b64 = {} # cache base-64 encoded images
|
images_b64 = {} # cache base-64 encoded images
|
||||||
num_images = 0 # just for debugging
|
|
||||||
re_xlink=re.compile(r"xlink:href=\"(?P<URL>.*?)\"", re.IGNORECASE)
|
re_xlink=re.compile(r"xlink:href=\"(?P<URL>.*?)\"", re.IGNORECASE)
|
||||||
with open(filename_in,'r') as file_in, open(filename_out,'w') as file_out:
|
with open(filename_in,'r') as file_in, open(filename_out,'w') as file_out:
|
||||||
for line in file_in:
|
for line in file_in:
|
||||||
for xlink in re_xlink.finditer(line):
|
for xlink in re_xlink.finditer(line):
|
||||||
num_images = num_images + 1
|
|
||||||
imgurl = xlink.group('URL')
|
imgurl = xlink.group('URL')
|
||||||
if not imgurl in images_b64:
|
if not imgurl in images_b64:
|
||||||
if not Path(imgurl).is_absolute(): # resolve relative image path
|
if not Path(imgurl).is_absolute(): # resolve relative image path
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user