chad_faragher_6128547's profile

2 Messages

 • 

100 Points

Thu, Nov 21, 2013 1:17 PM

Photoshop: Doesn't load pgm files correctly.

The following PGM file doesn't load correctly:

P2
4 4
511
0 0 511 511
0 0 511 511
0 0 511 511
0 0 511 511

It seems to have something to do with the fact that the maximum gray value (Maxval) is greater than 255. But maximum gray values between 1 and 65535 are allowable according to the spec. It is correctly determined that a 16 bits-per-channel format is needed, but the pixels are in the wrong place.

Responses

15.1K Messages

 • 

195.8K Points

8 y ago

Hmm, I think that when that code was written (early 90s), PGM was limited to a maximum of 255. I'll take a look and see if that can be fixed/updated.