From 6952113750c45b9d9059087c64f85f38a1c26791 Mon Sep 17 00:00:00 2001 From: "yi.cheng" Date: Wed, 22 Nov 2023 19:07:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8A=E4=BC=A0=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check_compress_psd.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/check_compress_psd.py b/check_compress_psd.py index 8baaca1..99c97ab 100644 --- a/check_compress_psd.py +++ b/check_compress_psd.py @@ -34,7 +34,9 @@ def parse_psd(path): has_thumbnail = False lines = {} patch_stages = {} + spatch_stages = {} bad_stages = {} + sbad_stages = {} auto_stages = {} #patch的末尾数字 @@ -100,6 +102,13 @@ def parse_psd(path): patch_stages[nArr[1]].append(nArr[2]) patch_end.append(item.name.replace("patch", "")) + elif nArr[0] == 'spatch': + if nArr[1] not in spatch_stages: + spatch_stages[nArr[1]] = [] + + spatch_stages[nArr[1]].append(f"{nArr[2]}_{nArr[3]}") + + patch_end.append(item.name.replace("spatch", "")) elif nArr[0] == 'bad': if nArr[1] not in bad_stages: bad_stages[nArr[1]] = [] @@ -107,6 +116,13 @@ def parse_psd(path): bad_stages[nArr[1]].append(nArr[2]) bad_end.append(item.name.replace("bad", "")) + elif nArr[0] == 'sbad': + if nArr[1] not in sbad_stages: + sbad_stages[nArr[1]] = [] + + sbad_stages[nArr[1]].append(f"{nArr[2]}_{nArr[3]}") + + bad_end.append(item.name.replace("sbad", "")) elif nArr[0] == 'auto': if nArr[1] not in auto_stages: auto_stages[nArr[1]] = [] @@ -181,6 +197,14 @@ def parse_psd(path): for item in patch_end: if item not in bad_end: log.append("拼图图层找不到bad图层:patch{}".format(item)) + + for stage in spatch_stages: + tmp = {} + for item in spatch_stages[stage]: + if item in tmp: + log.append("存在重复图层:spatch_{}_{}".format(stage, item)) + else: + tmp[item] = 0 log.append("检测结束")