aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-06-19 14:30:03 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-06-19 14:30:03 -0700
commit5cb53a48d541b97b5f60968715a5969133196d70 (patch)
tree2f58f13bf236ab78e68e94d5081c2552d568d2eb /src
parent84391a887dc3fae00bc20419ad163ef4af445f0e (diff)
downloadpandoc-5cb53a48d541b97b5f60968715a5969133196d70.tar.gz
ImageSize: ignore unknown exif header tag rather than crashing.
Some images seem to have tag type of 256, which was causing a runtime error.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/ImageSize.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index a6d076fa9..9e6b457c0 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -217,7 +217,7 @@ exifHeader hdr = do
numentries <- getWord16
let ifdEntry = do
tag <- getWord16 >>= \t ->
- maybe (fail $ "Unknown tag type " ++ show t) return
+ maybe (return UnknownTagType) return
(M.lookup t tagTypeTable)
dataFormat <- getWord16
numComponents <- getWord32
@@ -337,6 +337,7 @@ data TagType = ImageDescription
| SensingMethod
| FileSource
| SceneType
+ | UnknownTagType
deriving (Show, Eq, Ord)
tagTypeTable :: M.Map Word16 TagType