| 362 | |
| 363 | |
| 364 | ILimage *ilReadBinaryPpm(PPMINFO *Info) |
| 365 | { |
| 366 | ILuint Size; |
| 367 | |
| 368 | Size = Info->Width * Info->Height * Info->Bpp; |
| 369 | |
| 370 | if (!ilTexImage(Info->Width, Info->Height, 1, (ILubyte)(Info->Bpp), 0, IL_UNSIGNED_BYTE, NULL)) { |
| 371 | return IL_FALSE; |
| 372 | } |
| 373 | iCurImage->Origin = IL_ORIGIN_UPPER_LEFT; |
| 374 | |
| 375 | /* 4/3/2007 Dario Meloni |
| 376 | Here it seems we have eaten too much bytes and it is needed to fix |
| 377 | the starting point |
| 378 | works well on various images |
| 379 | |
| 380 | No more need of this workaround. fixed iGetWord |
| 381 | iseek(0,IL_SEEK_END); |
| 382 | ILuint size = itell(); |
| 383 | iseek(size-Size,IL_SEEK_SET); |
| 384 | */ |
| 385 | if (iread(iCurImage->Data, 1, Size ) != Size) { |
| 386 | ilCloseImage(iCurImage); |
| 387 | return NULL; |
| 388 | } |
| 389 | return iCurImage; |
| 390 | } |
| 391 | |
| 392 | |
| 393 | ILimage *ilReadBitPbm(PPMINFO *Info) |
no test coverage detected