Ai
3 Star 0 Fork 0

Gitee 极速下载/scuttlebutt-protocol-guide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/ssbc/scuttlebutt-protocol-guide
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rasterize.py 772 Bytes
一键复制 编辑 原始数据 按行查看 历史
import os
import subprocess
import re
# This script converts SVG images into PNG.
# Requires Python 3, Inkscape and pngquant.
self_dir = os.path.dirname(__file__)
img_dir = os.path.join(self_dir, "img")
for svg_name in os.listdir(img_dir):
svg_path = os.path.join(img_dir, svg_name)
base, ext = os.path.splitext(svg_name)
if ext == ".svg":
png_name = "{0}.png".format(base)
png_path = os.path.join(img_dir, png_name)
if not os.path.exists(png_path) or os.path.getmtime(svg_path) > os.path.getmtime(png_path):
print(svg_name)
subprocess.run(["inkscape", "-z", "-e", png_path, "-d", "192", svg_path])
subprocess.run(["pngquant", "--ext", ".png", "--force", "--skip-if-larger", "--strip", png_path])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/scuttlebutt-protocol-guide.git
git@gitee.com:mirrors/scuttlebutt-protocol-guide.git
mirrors
scuttlebutt-protocol-guide
scuttlebutt-protocol-guide
master

搜索帮助