I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)

Talk:Bitmap/Write a PPM file

From Rosetta Code

Haskell code is wrong?[edit]

Binary PPM files should have the header "P6", and PPM files in plain ASCII should have the header "P3". However, the Haskell code reads a file in ASCII but checks if its header is "P6", and complains if the file data is raw bytes. That should be corrected.     -- Issam


Code in C# is wrong?[edit]

Code in C# is wrong. using Environment.NewLine will cause the data section to be shifted in a way that the first few RGBRGBRGB... will be lost, and what will be written actually starts with "G", so the output data section will be GBR instead of RGB. this is because Environment.NewLine will write CR+LF (Windows) which is not a single whitespace as the PPM specification says, but in fact two whitespaces. if Environment.NewLine is substituted with " " (Space), it works.     -- Avillen