注释增加

This commit is contained in:
Luthics 2023-01-09 21:00:03 +08:00
parent 271b30e24f
commit a2bd7237fa
1 changed files with 8 additions and 2 deletions

10
main.py
View File

@ -83,7 +83,7 @@ else:
angle = int(new)
if (angle not in [90, 180, 270]):
error(4)
mode = 2
################## 数据输入 End ##################
@ -286,6 +286,7 @@ for currentRow in tqdm(range(new_height), "计算新像素点中"):
newpixels[currentRow].append(pixels[ori_row][ori_col])
################## 缩放图片 End ##################
################## 字节计算 Start ##################
# 处理新文件
newimgArray = [66, 77]
@ -415,10 +416,15 @@ for i in tqdm(range(len(newpixels)), "将像素点格式化中"):
newimgArray.extend(pixel)
newimgArray.extend(sizeByte(0, rowLength - len(row) * (new_bpp // 8)))
################## 字节计算 END ##################
################## 写出文件 Start ##################
# 写入新的文件
newimgBytes = bytes(newimgArray)
with open(output_file, 'wb') as f:
f.write(newimgBytes)
for _ in tqdm(range(len(newimgBytes)), "写出图片中"):
pass
pass
################## 写出文件 End ##################