fix split width height
This commit is contained in:
parent
b2268dbb06
commit
7c8d546a25
@ -62,7 +62,6 @@ class imageUtils:
|
|||||||
def splitimage(cls,src,rownum,colnum,dstpath):
|
def splitimage(cls,src,rownum,colnum,dstpath):
|
||||||
img=Image.open(src)
|
img=Image.open(src)
|
||||||
w,h=img.size
|
w,h=img.size
|
||||||
if rownum<= h and colnum<=w:
|
|
||||||
s=os.path.split(src)
|
s=os.path.split(src)
|
||||||
if dstpath=='':
|
if dstpath=='':
|
||||||
dstpath = s[0]
|
dstpath = s[0]
|
||||||
@ -82,8 +81,6 @@ class imageUtils:
|
|||||||
print("file_path=",file_path)
|
print("file_path=",file_path)
|
||||||
img.crop(box).save(file_path)
|
img.crop(box).save(file_path)
|
||||||
num=num+1
|
num=num+1
|
||||||
else:
|
|
||||||
print('不数!')
|
|
||||||
img.close
|
img.close
|
||||||
return src
|
return src
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user