ISEPOS-2373 Also store the bounding box as a data attribute for quick access

This commit is contained in:
Mieszko Makuch 2025-05-07 12:59:21 +02:00
parent c20f7c06a7
commit cce0cd258d

View File

@ -536,6 +536,11 @@ verbose: {verbose}")
meta_elem = ET.SubElement(root, "metadata") meta_elem = ET.SubElement(root, "metadata")
meta_elem.text = json.dumps(bbox_dict) meta_elem.text = json.dumps(bbox_dict)
# (Optional) Also store the bounding box as a data attribute for quick access
root.set("data-bbox", json.dumps(bbox_dict))
tree.write(svg_path, encoding="utf-8", xml_declaration=True)
logger.info(f"Embedded bbox into {svg_path}{bbox_dict}")
# ----------------------------------------- # -----------------------------------------
# END Inject bounding box (BBOX) metadata into the SVG # END Inject bounding box (BBOX) metadata into the SVG
# ----------------------------------------- # -----------------------------------------