pdmark / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

image_to_j2k not outputting to win32 console properly #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to redirect console output to a GUI
2.
3.

What is the expected output? What do you see instead?
Expected: See image_to_j2k output in my app
Instead: Nothing until it has completed

What version of the product are you using? On what operating system?
v1.3 image_to_j2k on Win XP SP3

Please provide any additional information below.
After reading, apparently this behaviour is because the console 
application is buffering text into a pipe instead of simply printing.
Apprently, in C++, setting the following will correct this issue:
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);

Original issue reported on code.google.com by james...@gmail.com on 13 Mar 2010 at 1:56

GoogleCodeExporter commented 9 years ago
Could you propose a patch with your proposed fix ?

Original comment by fodev...@gmail.com on 8 Apr 2010 at 6:30

GoogleCodeExporter commented 9 years ago
Hi,
I tried modifying the source-code to include those lines of code, but it 
failed. 
Maybe it was where I put them, I'm not sure. Instead, I have re-written all the 
print statements that I need to acertain a status of how the encoding is going. 
When 
run in a console, it's exactly the same as before, just my app can now see what 
is 
being output.

Original comment by james...@gmail.com on 26 May 2010 at 10:44