Commit 338dc5f7 by sikang

test

parent 0ce440d7
......@@ -39,9 +39,12 @@ class ImageGarble:
if file.endswith(".png") or file.endswith(".webp"):
path = os.path.join(root,file)
os.system("md5 %s"%path)
img = Image.open(path)
img.putpixel((0,0),(random.randint(0,255),random.randint(0,255),random.randint(0,255),random.randint(0,255)))
img.save(path)
try:
img = Image.open(path)
img.putpixel((0,0),(random.randint(0,255),random.randint(0,255),random.randint(0,255),random.randint(0,255)))
img.save(path)
except:
print(path + " 处理失败")
os.system("md5 %s"%path)
#创建随机图片
if len(files) > 0 and (".png" in str(files) or ".webp" in str(files)) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment