git.iko.soy/typeable/pandoc
on master help sign in
Avoid non-exhaustive pattern matches.
7a1ec21John MacFarlane
src/Text/Pandoc/ImageSize.hs+6−4
@@ -544,10 +544,12 @@ exifHeader hdr = do
544 let resfactor = case lookup ResolutionUnit allentries of
544 let resfactor = case lookup ResolutionUnit allentries of
545 Just (UnsignedShort 1) -> 100 / 254
545 Just (UnsignedShort 1) -> 100 / 254
546 _ -> 1
546 _ -> 1
547− let xres = maybe 72 (\(UnsignedRational x) -> floor $ x * resfactor)
548− $ lookup XResolution allentries
547+ let xres = case lookup XResolution allentries of
549− let yres = maybe 72 (\(UnsignedRational x) -> floor $ x * resfactor)
548+ Just (UnsignedRational x) -> floor (x * resfactor)
549+ _ -> 72
550− $ lookup YResolution allentries
550+ let yres = case lookup YResolution allentries of
551+ Just (UnsignedRational y) -> floor (y * resfactor)
552+ _ -> 72
551 return ImageSize{
553 return ImageSize{
552 pxX = wdth
554 pxX = wdth
553 , pxY = hght
555 , pxY = hght