From a56419293de0faf068a0741dd70f6649ca3790ec Mon Sep 17 00:00:00 2001 From: misaka10843 Date: Sun, 24 Nov 2024 19:40:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Image_stitching.py | 40 ---------------------------------------- main.py | 3 +-- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 Image_stitching.py diff --git a/Image_stitching.py b/Image_stitching.py deleted file mode 100644 index 982e060..0000000 --- a/Image_stitching.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding:utf-8 -*- - - -import os - -from PIL import Image - - -def file_name(file_dir): - L = [] - for root, dirs, files in os.walk(file_dir): - for file in files: - if os.path.splitext(file)[1] == '.png': # 假设漫画全部都是png格式 - L.append(os.path.join(root, file)) # 输出为数组 - return L - - -def join(png1, png2, NewImageName, SavePath): - img1, img2 = Image.open(png1), Image.open(png2) - size1, size2 = img1.size, img2.size # 获取两个图片长宽 - joint = Image.new('RGB', (size1[0] + size2[0], size1[1])) - loc1, loc2 = (0, 0), (size1[0], 0) - joint.paste(img2, loc1) # 如需要左到右拼接,只要将img2改成img1,img1改成img2即可 - joint.paste(img1, loc2) - joint.save('%s%s.png' % (SavePath, NewImageName)) # 输出 - - -def main(): - ImgPath = input("图片文件夹位置(以/结尾):") - SavePath = input("拼接后图片存放的位置(以/结尾):") - image = file_name("ImgPath") # 获取当前目录下指定文件 - j = 0 - for i in image: - NewImage = "%s-%s" % (j + 1, j) # 拼接之后的图片的文件名 - join(image[j], image[j + 1], NewImage, SavePath) # 如果是第一次就直接两图合并 - j = j + 1 - - -if __name__ == '__main__': - main() diff --git a/main.py b/main.py index e1e0ea4..58425c3 100644 --- a/main.py +++ b/main.py @@ -265,13 +265,12 @@ def update_get_chapter(manga_path_word, manga_group_path_word, now_chapter): time.sleep(5) response.raise_for_status() manga_chapter_json = response.json() - # Todo 创建传输的json,并且之后会将此json保存为temp.json修复这个问题https://github.com/misaka10843/copymanga-downloader/issues/35 return_json = { "json": manga_chapter_json, "start": -1, "end": -1 } - # Todo 支持500+话的漫画(感觉并不太需要) + # Todo 支持500+话的漫画(感觉并不太需要,如果真的要下的话就添加进半自动更新里面吧x) if not manga_chapter_json['results']['list']: print(f"[bold blue]此漫画并未有新的章节,我们将跳过此漫画[/]") return 0