diff options
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/FB2.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/ICML.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/ODT.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/RTF.hs | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 3d6eb9fe5..6102d97ed 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -1295,7 +1295,7 @@ inlineToOpenXML' opts (Image attr alt (src, title)) = do Just (_,_,_,elt,_) -> return [elt] Nothing -> do catchError - (do (img, mt) <- P.fetchItem (writerSourceURL opts) src + (do (img, mt) <- P.fetchItem src ident <- ("rId"++) `fmap` ((lift . lift) getUniqueId) let (xpt,ypt) = desiredSizeInPoints opts attr (either (const def) id (imageSize opts img)) diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 04126fbb7..6bae65b6b 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -918,7 +918,7 @@ modifyMediaRef opts oldsrc = do case lookup oldsrc media of Just (n,_) -> return n Nothing -> catchError - (do (img, mbMime) <- P.fetchItem (writerSourceURL opts) oldsrc + (do (img, mbMime) <- P.fetchItem oldsrc let new = "media/file" ++ show (length media) ++ fromMaybe (takeExtension (takeWhile (/='?') oldsrc)) (('.':) <$> (mbMime >>= extensionFromMimeType)) diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 4c764d987..36c572b63 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -255,7 +255,7 @@ fetchImage href link = do else return Nothing (True, Just _) -> return Nothing -- not base64-encoded _ -> do - catchError (do (bs, mbmime) <- P.fetchItem Nothing link + catchError (do (bs, mbmime) <- P.fetchItem link case mbmime of Nothing -> do report $ CouldNotDetermineMimeType link diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index 37df58e65..650a1c012 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -543,7 +543,7 @@ styleToStrAttr style = imageICML :: PandocMonad m => WriterOptions -> Style -> Attr -> Target -> WS m Doc imageICML opts style attr (src, _) = do imgS <- catchError - (do (img, _) <- P.fetchItem (writerSourceURL opts) src + (do (img, _) <- P.fetchItem src case imageSize opts img of Right size -> return size Left msg -> do diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs index 4c74ef469..90b7c3501 100644 --- a/src/Text/Pandoc/Writers/ODT.hs +++ b/src/Text/Pandoc/Writers/ODT.hs @@ -180,7 +180,7 @@ addLang lang = everywhere' (mkT updateLangAttr) -- | transform both Image and Math elements transformPicMath :: PandocMonad m => WriterOptions ->Inline -> O m Inline transformPicMath opts (Image attr@(id', cls, _) lab (src,t)) = catchError - (do (img, mbMimeType) <- P.fetchItem (writerSourceURL opts) src + (do (img, mbMimeType) <- P.fetchItem src (ptX, ptY) <- case imageSize opts img of Right s -> return $ sizeInPoints s Left msg -> do diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 48d31c7bf..d4de3112c 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -56,7 +56,7 @@ import Text.Printf (printf) -- If file not found or filetype not jpeg or png, leave the inline unchanged. rtfEmbedImage :: PandocMonad m => WriterOptions -> Inline -> m Inline rtfEmbedImage opts x@(Image attr _ (src,_)) = catchError - (do result <- P.fetchItem (writerSourceURL opts) src + (do result <- P.fetchItem src case result of (imgdata, Just mime) | mime == "image/jpeg" || mime == "image/png" -> do |