Imread doesn't read PGM Image

ppm images have a text header. can you show yours ?

i dont think, the pxm importer handles 16bit properly

any chance, you can debug this ?

that said, ppm is the most simple image format ever.
c++ ifstream, 20 lines of code or so …