Skip to content

Commit 11f88f3

Browse files
committed
pbio/image: Rebuild PNG file if SVG file changed.
Check timestamp to rebuild PNG file as needed.
1 parent 18abf52 commit 11f88f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/pbio/src/image/media.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
for svg in svg_files:
1919
png = svg.with_suffix(".png").name
2020
png_path = build_dir / png
21-
if png_path.exists():
21+
if png_path.exists() and png_path.stat().st_mtime >= svg.stat().st_mtime:
2222
continue
2323
with open(svg, "rb") as svg_file:
2424
png_bytes = cairosvg.svg2png(file_obj=svg_file)

0 commit comments

Comments
 (0)