Closed
Description
Hi,
First off thank you for providing this demo program!
I've noticed that on Windows, it produces skewed images such as this one:
This is because your demo writes binary pixel values to stdout, which typically contain some 0x0A (Line Feed) bytes here and there.
Because Windows uses CR LF newlines, and stdout is usually in text mode (think fopen(,"w")
, as opposed to fopen(,"wb"))
,
these 0x0A bytes will be replaced by a 0x0D 0x0A (CR LF) sequence during fwrite()
.
Consider writing images to a file instead of to the console.
Alternatively, you could use something like setmode(fileno(stdout), O_BINARY)
on Windows to force stdout into binary mode.
Metadata
Metadata
Assignees
Labels
No labels