aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/ImageSize.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-01-14 10:12:33 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-01-14 10:13:08 -0800
commita1abb3eeea2321654a8450725ff6c0d1a18ee0c7 (patch)
tree5a48c7eff74e45738c59aafaee83cbd15c561bf9 /src/Text/Pandoc/ImageSize.hs
parent68b438b1b8a4fb56a79db020770cf71394fbc214 (diff)
downloadpandoc-a1abb3eeea2321654a8450725ff6c0d1a18ee0c7.tar.gz
Allow binary 0.5. Version bump to 1.12.3.1.
Diffstat (limited to 'src/Text/Pandoc/ImageSize.hs')
-rw-r--r--src/Text/Pandoc/ImageSize.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index d1aacff1c..14575244d 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -182,9 +182,12 @@ findJfifSize bs = do
Nothing -> fail "Did not find length record"
exifSize :: ByteString -> Maybe ImageSize
-exifSize = -- runGet ((Just <$> exifHeader) `mplus` return Nothing) .
- runGet (Just <$> exifHeader) .
- BL.fromChunks . (:[])
+exifSize = runGet (Just <$> exifHeader) . BL.fromChunks . (:[])
+-- NOTE: It would be nicer to do
+-- runGet ((Just <$> exifHeader) <|> return Nothing)
+-- which would prevent pandoc from raising an error when an exif header can't
+-- be parsed. But we only get an Alternative instance for Get in binary 0.6,
+-- and binary 0.5 ships with ghc 7.6.
exifHeader :: Get ImageSize
exifHeader = do