bug-ocrad
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ocrad] Ocrad opens files in text mode


From: skip
Subject: [Bug-ocrad] Ocrad opens files in text mode
Date: Fri, 20 Oct 2006 14:26:34 -0500

In the SpamBayes project (http://www.spambayes.org/) we're starting to use
ocrad as an OCR tool.  It works well on Unix-oid systems, but fails on
Windows.  We tracked it down to the fact that the input files are not opened
in binary mode:

    if( std::strcmp( infile_name, "-" ) == 0 ) infile = stdin;
    else infile = std::fopen( infile_name, "r" );

There should be a "b" in that mode string.  Alas, it's not clear how you can
place stdin in binary mode, so input redirection will probably always fail.

We've built ocrad for Windows using cygwin set up in such a way that the
cygwin runtime isn't needed (probably some static linkage flags - I didn't
perform that step).

-- 
Skip Montanaro - address@hidden - http://www.mojam.com/
"The hippies and the hipsters did some great stuff in the sixties,
but the geeks pulled their weight too." -- Billy Bragg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]