Anonymous user
Bitmap/Read a PPM file: Difference between revisions
no edit summary
(→Tcl: Added implementation) |
No edit summary |
||
Line 124:
r = sscanf(buf, "%u %u", &w, &h);
if ( r < 2 ) return NULL;
// The program fails if the first byte of the image is equal to 32. because the fscanf eats the space and the image is read with some bit less
r = fscanf(pf, "%u\n", &d);
if ( (r < 1) || ( d != 255 ) ) return NULL;
|