summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/ImageSize.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/ImageSize.hs')
-rw-r--r--src/Text/Pandoc/ImageSize.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index f21284dac..1d6db8dfa 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -283,8 +283,10 @@ pdfSize img =
"/MediaBox" `B.isPrefixOf` l)) (B.lines img) of
(x:_)
| "/MediaBox" `B.isPrefixOf` x
- -> case B.words $ B.filter (\c -> c /= '[' && c /= ']')
- $ B.drop 10 x of
+ -> case B.words . B.takeWhile (/=']')
+ . B.drop 1
+ . B.dropWhile (/='[')
+ $ x of
[x1, y1, x2, y2] -> do
x1' <- safeRead $ B.unpack x1
x2' <- safeRead $ B.unpack x2