diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-03-12 16:19:07 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-03-12 16:19:07 -0700 |
commit | a8660f5c7c3516e0650d63131d1ca6b5be10eddc (patch) | |
tree | 72255d22ebaee15ef1522a721f6bdb5118ef4984 | |
parent | e8002484da81d88e2de218468ed920ab9b1848d2 (diff) | |
download | sscan-a8660f5c7c3516e0650d63131d1ca6b5be10eddc.tar.gz |
give ocrmypdf a binary stdout
-rw-r--r-- | Main.hs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -35,7 +35,7 @@ import System.Exit (ExitCode (..)) import System.FilePath ((<.>), (</>)) import System.IO (IOMode (WriteMode), hClose, hGetContents, hPutStr, openFile, - withFile) + withBinaryFile, withFile) import System.IO.Temp (withSystemTempDirectory) import System.Process @@ -67,7 +67,7 @@ processScanSessDir st dir = withCurrentDirectory dir $ do renamePath (dir </> "temp.pdf") (dir </> "temp2.pdf") -- OCRmyPDF dies if stdout is not connected, so tell it -- to output to stdout - void $ withFile "temp.pdf" WriteMode $ \tempFile -> do + void $ withBinaryFile "temp.pdf" WriteMode $ \tempFile -> do (_, _, Just herr, p) <- createProcess_ "OCRmyPDF" -- we'd like to use --remove-background here, but then -- qpdf says that ocrmypdf's output is damaged. |