libpng warning: Ignoring bad adaptive filter type

2020-07-18 03:22发布

my app was killed,and the log :libpng warning: Ignoring bad adaptive filter type. I want to know the reason,and the solution.

2条回答
放荡不羁爱自由
2楼-- · 2020-07-18 04:03

The question gives insufficient information to provide a complete answer.

The "bad adaptive filter type" message means that the PNG file is either corrupted or was generated by a buggy encoder.

Each scanline of a PNG file begins with a "filter type" byte which must be 0, 1, 2, 3, or 4.

查看更多
来,给爷笑一个
3楼-- · 2020-07-18 04:15

I had this issue before, the image was corrupted by unknown reason, the solution of catching such an error can be using the code below (in Python):

try:
    Image.open(path).tobytes()
except IOError:
    print('detect error img %s' % path)
    continue
查看更多
登录 后发表回答