修复了文件使用旧w/h的bug
This commit is contained in:
parent
26dbe49686
commit
f5bbb83f62
6
main.py
6
main.py
|
@ -294,16 +294,16 @@ for currentRow in tqdm(range(new_height), "计算新像素点中"):
|
|||
newimgArray = [66, 77]
|
||||
|
||||
if (angle in [0, 180]):
|
||||
rowLength = floor(width * bpp / 8)
|
||||
rowLength = floor(new_width * bpp / 8)
|
||||
while (rowLength % 4 != 0 or rowLength == 0):
|
||||
rowLength += 1
|
||||
new_fileSize = 54 + rowLength * new_height #文件头中的文件大小
|
||||
new_imageSize = rowLength * new_height
|
||||
else:
|
||||
rowLength = floor(height * bpp / 8)
|
||||
rowLength = floor(new_height * bpp / 8)
|
||||
while (rowLength % 4 != 0 or rowLength == 0):
|
||||
rowLength += 1
|
||||
new_fileSize = 54 + rowLength * new_height #文件头中的文件大小
|
||||
new_fileSize = 54 + rowLength * new_width #文件头中的文件大小
|
||||
new_imageSize = rowLength * new_width
|
||||
|
||||
# 新文件头
|
||||
|
|
Loading…
Reference in New Issue