parent
c4f6e6cb57
commit
811601aa8b
1 changed files with 3 additions and 2 deletions
|
@ -43,10 +43,11 @@ rtfEmbedImage opts x@(Image attr _ (src,_)) = catchError
|
||||||
(do result <- P.fetchItem src
|
(do result <- P.fetchItem src
|
||||||
case result of
|
case result of
|
||||||
(imgdata, Just mime)
|
(imgdata, Just mime)
|
||||||
| mime == "image/jpeg" || mime == "image/png" -> do
|
| mime' <- T.takeWhile (/=';') mime
|
||||||
|
, mime' == "image/jpeg" || mime' == "image/png" -> do
|
||||||
let bytes = map (T.pack . printf "%02x") $ B.unpack imgdata
|
let bytes = map (T.pack . printf "%02x") $ B.unpack imgdata
|
||||||
filetype <-
|
filetype <-
|
||||||
case mime of
|
case mime' of
|
||||||
"image/jpeg" -> return "\\jpegblip"
|
"image/jpeg" -> return "\\jpegblip"
|
||||||
"image/png" -> return "\\pngblip"
|
"image/png" -> return "\\pngblip"
|
||||||
_ -> throwError $
|
_ -> throwError $
|
||||||
|
|
Loading…
Reference in a new issue