Fork自 PaddlePaddle / PaddleOCR
Added other image formats that are already verified by imghdr. Not sure about "pgm" format?