import time
import matplotlib.image as mping
def getPngSize(pngPath ="aa.png"):
print("获取图片尺寸大小:"+ str(pngPath))
try:
lena = mping.imread(pngPath)
except:
time.sleep(0.5)
print("读图出错,重读")
getPngSize(pngPath)
size = tuple(lena.shape)
print(size)
return size[1],size[0]
print(getPngSize())
import matplotlib.image as mping
def getPngSize(pngPath ="aa.png"):
print("获取图片尺寸大小:"+ str(pngPath))
try:
lena = mping.imread(pngPath)
except:
time.sleep(0.5)
print("读图出错,重读")
getPngSize(pngPath)
size = tuple(lena.shape)
print(size)
return size[1],size[0]
print(getPngSize())