Stream read error loading ppm into TImage
Original Reporter info from Mantis: MaartenJB
-
Reporter name:
Original Reporter info from Mantis: MaartenJB
- Reporter name:
Description:
Hi, I've got a problem with loading ppm files into a TImage.
When loading a .ppm image into a TImage I get a "stream read error".
Steps to reproduce:
// Not all ppm files generate this problem.
// the attached example file does
Image1.Picture.LoadFromFile('test.ppm');
Additional information:
The test ppm file is generated with libjpeg-turbo ( http://libjpeg-turbo.virtualgl.org ). Not all converted images generate this problem, but most do. All ppm files can be opened without any problems in normal picture viewers.
D:\testing>file *.ppm
test.ppm: Netpbm PPM "rawbits" image data
Traceback
An unhandled exception occurred at $00413972:
EReadError: Stream read error
$00413972 TSTREAM__READBUFFER, line 189 of d:/repo/fpc/rtl/objpas/classes/streams.inc
$00411078 TFPREADERPNM__READSCANLINE, line 193 of ./fcl-image/src/fpreadpnm.pp
$00410E95 TFPREADERPNM__INTERNALREAD, line 144 of ./fcl-image/src/fpreadpnm.pp
$00412C09 TFPCUSTOMIMAGEREADER__IMAGEREAD, line 230 of ./fcl-image/src/fphandler.inc
$0041187D TFPCUSTOMIMAGE__LOADFROMSTREAM, line 37 of ./fcl-image/src/fpimage.inc
$004118DC TFPCUSTOMIMAGE__LOADFROMFILE, line 48 of ./fcl-image/src/fpimage.inc
$004015AD X, line 14 of bug21564.pp
$004015DD main, line 19 of bug21564.pp
Mantis conversion info:
- Mantis ID: 21564
- OS: Windows
- OS Build: 7
- Platform: Windows
- Version: 2.6.0
- Fixed in version: 3.0.0
- Fixed in revision: 26698 (#9699890e)
- Target version: 3.0.0