再次修复
This commit is contained in:
1 parent
d188ef2b33
commit
4c838fb1ed
2 files changed
+13
-5
No files matched your search
@@ -48,5 +48,10 @@ class CBZUtils:
|
|||||||
def packAutoComicChapterCBZ(cls):
|
def packAutoComicChapterCBZ(cls):
|
||||||
chapter_path = comicInfo.getDirComicChapter()
|
chapter_path = comicInfo.getDirComicChapter()
|
||||||
packCBZ_path = comicInfo.getDirCBZComicChapter()
|
packCBZ_path = comicInfo.getDirCBZComicChapter()
|
||||||
|
if os.path.exists(chapter_path):
|
||||||
|
dirs = os.listdir(chapter_path)
|
||||||
|
for file in dirs:
|
||||||
|
if file.startswith("scramble="):
|
||||||
|
os.remove(file)
|
||||||
cls.zip_compression(chapter_path,packCBZ_path+".CBZ")
|
cls.zip_compression(chapter_path,packCBZ_path+".CBZ")
|
||||||
comicInfo.nextCBZToDoneChapter()
|
comicInfo.nextCBZToDoneChapter()
|
||||||
+8
-5
@@ -54,7 +54,7 @@ class imageUtils:
|
|||||||
if image_su == "downloads":
|
if image_su == "downloads":
|
||||||
return None
|
return None
|
||||||
cls.splitimage(file_path,blocks,1,split_path)
|
cls.splitimage(file_path,blocks,1,split_path)
|
||||||
cls.image_compose(split_path+"/",blocks,1,save_file_path,blockHeight,width)
|
cls.image_compose(split_path,blocks,1,save_file_path,blockHeight,width)
|
||||||
#完成后清空
|
#完成后清空
|
||||||
return file_path
|
return file_path
|
||||||
|
|
||||||
@@ -85,6 +85,7 @@ class imageUtils:
|
|||||||
else:
|
else:
|
||||||
print('不数!')
|
print('不数!')
|
||||||
img.close
|
img.close
|
||||||
|
return src
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def image_compose(cls,src,row,column,save_path,image_height,image_width):
|
def image_compose(cls,src,row,column,save_path,image_height,image_width):
|
||||||
@@ -102,7 +103,7 @@ class imageUtils:
|
|||||||
img_nums=len(img_list)
|
img_nums=len(img_list)
|
||||||
image_names = []
|
image_names = []
|
||||||
for i in range(img_nums):
|
for i in range(img_nums):
|
||||||
img_name=src+img_list[i]
|
img_name=os.path.join(src,img_list[i])
|
||||||
image_names.append(img_name)
|
image_names.append(img_name)
|
||||||
#使用倒序
|
#使用倒序
|
||||||
image_names = image_names[::-1]
|
image_names = image_names[::-1]
|
||||||
@@ -115,13 +116,14 @@ class imageUtils:
|
|||||||
for y in range(1, row + 1):
|
for y in range(1, row + 1):
|
||||||
for x in range(1, column + 1):
|
for x in range(1, column + 1):
|
||||||
#1 * (row=1 -1) col=1 -1
|
#1 * (row=1 -1) col=1 -1
|
||||||
image_path = src + image_names[column * (y - 1) + x - 1]
|
image_path = image_names[column * (y - 1) + x - 1]
|
||||||
print("split_image=",image_path)
|
print("split_image=",image_path)
|
||||||
from_image = Image.open(image_path)
|
from_image = Image.open(image_path)
|
||||||
#保持原图片大小
|
#保持原图片大小
|
||||||
#.resize(
|
#.resize(
|
||||||
# (image_size, image_size),Image.ANTIALIAS)
|
# (image_size, image_size),Image.ANTIALIAS)
|
||||||
to_image.paste(from_image, ((x - 1) * image_size, (y - 1) * image_size))
|
to_image.paste(from_image, ((x - 1) * image_size, (y - 1) * image_size))
|
||||||
|
from_image.close()
|
||||||
to_image.save(save_path)
|
to_image.save(save_path)
|
||||||
print("图片合并完成:", save_path)
|
print("图片合并完成:", save_path)
|
||||||
shutil.rmtree(src)
|
shutil.rmtree(src)
|
||||||
@@ -130,5 +132,6 @@ class imageUtils:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def getScrambleImage(cls,path):
|
def getScrambleImage(cls,path):
|
||||||
scrambleFileCache = cls.scrambleImage(path)
|
scrambleFileCache = cls.scrambleImage(path)
|
||||||
if os.path.exists(scrambleFileCache):
|
if not scrambleFileCache == None:
|
||||||
os.remove(scrambleFileCache)
|
if os.path.exists(scrambleFileCache):
|
||||||
|
os.remove(scrambleFileCache)
|
||||||
Reference in new issue
Block a user