View Issue Details

IDProjectCategoryView StatusLast Update
0035080FPCFCLpublic2019-12-05 13:52
ReporterhanAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSOS Version10
Product VersionProduct Build 
Target VersionFixed in Version3.3.1 
Summary0035080: FCL-image, FPwritePNM can't write 16bit and FPreadPNM reads wrongly 16 bit images
DescriptionThe package FCL-image is in general 16 bit.

Exporting via FPwritePNM is in 8 bit format only. Many software package (PhotoShop, DRRAW can write 16 bit files. Suggest to extend the PNM read and write routine to 16 bit.(RGB48 or Gray16)

Reading of a 16 bit file (.PPM .PGM) looks it is supported in the reader but the the result is wrong. I suspect the HI and LOW bytes are swapped against the semi standard (as by PhotoShop, DCRAW, ASTAP). Suggest to correct this.

And as last suggestion in the writer code is an inefficient test for dataabove 255. Suggest to provide a boolean to set 8 or 16 bit output format.

Note a 16 bit header looks like this (without comments}:

P6 {type P6}
185 {width}
272 {height}
65535 {<==16 bit}

So 65535 rather then 255.


Attached several test files.

Steps To ReproduceUse attached 16 bit file with the reader
TagsNo tags attached.
Fixed in Revision43642
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

han

2019-02-13 23:55

reporter  

NETPBM test files.zip (553,440 bytes)

Michael Van Canneyt

2019-12-05 13:52

administrator   ~0119624

Fixed reading, (endianness was to blame) Implemented writing. FullWidth property now enabled16-bit writing.

Issue History

Date Modified Username Field Change
2019-02-13 23:55 han New Issue
2019-02-13 23:55 han File Added: NETPBM test files.zip
2019-02-14 00:23 Maxim Ganetsky Project Packages => FPC
2019-02-15 13:52 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-02-15 13:52 Michael Van Canneyt Status new => assigned
2019-12-05 13:52 Michael Van Canneyt Status assigned => resolved
2019-12-05 13:52 Michael Van Canneyt Resolution open => fixed
2019-12-05 13:52 Michael Van Canneyt Fixed in Version => 3.3.1
2019-12-05 13:52 Michael Van Canneyt Fixed in Revision => 43642
2019-12-05 13:52 Michael Van Canneyt FPCTarget => 3.2.0
2019-12-05 13:52 Michael Van Canneyt Note Added: 0119624