Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对有些皮肤文件,转换时会出现数值溢出的问题 #20

Open
Feiyuqwq opened this issue Aug 10, 2024 · 2 comments
Open

对有些皮肤文件,转换时会出现数值溢出的问题 #20

Feiyuqwq opened this issue Aug 10, 2024 · 2 comments

Comments

@Feiyuqwq
Copy link

Feiyuqwq commented Aug 10, 2024

问题描述:在对某些皮肤文件进行fcitx5格式转换时出现报错:OverflowError: Python integer 493 out of bounds for uint8,报错位于222行,是对像素求平均值的时候出现的,由于此处使用的整数类型 uint8只能存储0-255,当加法结果超过255时,会导致溢出。
建议:把数据类型转化为int类型,这样可以解决该问题。
issue1
有此问题的皮肤文件: https://pinyin.sogou.com/d/skins/download.php?skin_id=607531&rf=cate_31

@Feiyuqwq Feiyuqwq changed the title 对有些皮肤文件,会出现数值溢出的问题 对有些皮肤文件,转换时会出现数值溢出的问题 Aug 10, 2024
@Feiyuqwq
Copy link
Author

不是批量转换这样做对运行效率的影响也不大,或者说其他方法的话比如用NumPy的mean函数直接计算平均值?

RadND pushed a commit to RadND/ssfconv that referenced this issue Sep 16, 2024
@RadND
Copy link

RadND commented Sep 16, 2024

@Feiyuqwq fork了一下修了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants