Open Feiyuqwq opened 2 months ago
问题描述:在对某些皮肤文件进行fcitx5格式转换时出现报错:OverflowError: Python integer 493 out of bounds for uint8,报错位于222行,是对像素求平均值的时候出现的,由于此处使用的整数类型 uint8只能存储0-255,当加法结果超过255时,会导致溢出。 建议:把数据类型转化为int类型,这样可以解决该问题。 有此问题的皮肤文件: https://pinyin.sogou.com/d/skins/download.php?skin_id=607531&rf=cate_31
不是批量转换这样做对运行效率的影响也不大,或者说其他方法的话比如用NumPy的mean函数直接计算平均值?
@Feiyuqwq fork了一下修了
问题描述:在对某些皮肤文件进行fcitx5格式转换时出现报错:OverflowError: Python integer 493 out of bounds for uint8,报错位于222行,是对像素求平均值的时候出现的,由于此处使用的整数类型 uint8只能存储0-255,当加法结果超过255时,会导致溢出。 建议:把数据类型转化为int类型,这样可以解决该问题。 有此问题的皮肤文件: https://pinyin.sogou.com/d/skins/download.php?skin_id=607531&rf=cate_31