评论

Asset validation failed (90717) 解决办法,关闭图片alpha通道

ios上传出现Asset validation failed (90717)错误 解决方法

ios上传出现Asset validation failed (90717)错误 解决方法

Asset validation failed (90717)

Invalid App Store Icon. The App Store Icon in the asset catalog in 'demo.app' can't be transparent nor contain an alpha channel. (ID: ee9a621e-b195-4e79-a700-0fbb1aa10c94)



import os
from PIL import Image

def remove_alpha_channel(input_folder, output_folder):
    # 确保输出文件夹存在
    os.makedirs(output_folder, exist_ok=True)

    # 遍历输入文件夹中的所有图像
    for filename in os.listdir(input_folder):
        input_path = os.path.join(input_folder, filename)
        output_path = os.path.join(output_folder, f"{os.path.splitext(filename)[0]}_no_alpha.png")

        # 打开图像
        image = Image.open(input_path)

        # 如果图像有 alpha 通道,去除它
        if image.mode in ('RGBA', 'LA') or (image.mode == 'P' and 'transparency' in image.info):
            image = image.convert('RGB')

        # 保存处理后的图像
        image.save(output_path)

# 输入文件夹  //输出文件夹
input_folder_path = 'G:\ios'
output_folder_path = 'G:\ios1'

remove_alpha_channel(input_folder_path, output_folder_path)

最后一次编辑于  2023-11-18  
点赞 2
收藏
评论
登录 后发表内容