diff options
Diffstat (limited to 'src/Text/Pandoc/ImageSize.hs')
-rw-r--r-- | src/Text/Pandoc/ImageSize.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs index 4c76aac13..e7698d148 100644 --- a/src/Text/Pandoc/ImageSize.hs +++ b/src/Text/Pandoc/ImageSize.hs @@ -126,7 +126,7 @@ imageType img = case B.take 4 img of | B.take 4 (B.drop 1 $ B.dropWhile (/=' ') img) == "EPSF" -> return Eps "\x01\x00\x00\x00" - | B.take 4 (B.drop 40 img) == " EMF" + | B.take 4 (B.drop 40 img) == " EMF" -> return Emf _ -> mzero @@ -361,9 +361,9 @@ svgSize opts img = do , dpiX = dpi , dpiY = dpi } - + emfSize :: ByteString -> Maybe ImageSize -emfSize img = +emfSize img = let parseheader = runGetOrFail $ do skip 0x18 -- 0x00 @@ -388,11 +388,11 @@ emfSize img = , dpiX = fromIntegral dpiW , dpiY = fromIntegral dpiH } - in + in case parseheader . BL.fromStrict $ img of Left _ -> Nothing Right (_, _, size) -> Just size - + jpegSize :: ByteString -> Either String ImageSize jpegSize img = |