Haskell Network.HTTP incorrectly downloading image

Viewed 1601

I'm trying to download images using the Network.HTTP module and having little success.

import Network.HTTP

main = do
  jpg <- get "http://www.irregularwebcomic.net/comics/irreg2557.jpg"
  writeFile "irreg2557.jpg" jpg where
       get url = simpleHTTP (getRequest url) >>= getResponseBody

The output file appears in the current directory, but fails to display under chromium or ristretto. Ristretto reports "Error interpreting JPEG image file (Not a JPEG file: starts with 0c3 0xbf)".

1 Answers
Related