git.iko.soy/typeable/pandoc
on master help sign in
ImageSize: ignore unknown exif header tag rather than crashing.
5cb53a4John MacFarlane
src/Text/Pandoc/ImageSize.hs+2−1
@@ -217,7 +217,7 @@ exifHeader hdr = do
217 numentries <- getWord16
217 numentries <- getWord16
218 let ifdEntry = do
218 let ifdEntry = do
219 tag <- getWord16 >>= \t ->
219 tag <- getWord16 >>= \t ->
220− maybe (fail $ "Unknown tag type " ++ show t) return
220+ maybe (return UnknownTagType) return
221 (M.lookup t tagTypeTable)
221 (M.lookup t tagTypeTable)
222 dataFormat <- getWord16
222 dataFormat <- getWord16
223 numComponents <- getWord32
223 numComponents <- getWord32
@@ -337,6 +337,7 @@ data TagType = ImageDescription
337 | SensingMethod
337 | SensingMethod
338 | FileSource
338 | FileSource
339 | SceneType
339 | SceneType
340+ | UnknownTagType
340 deriving (Show, Eq, Ord)
341 deriving (Show, Eq, Ord)
341
342
342tagTypeTable :: M.Map Word16 TagType
343tagTypeTable :: M.Map Word16 TagType