From edf906e4187ed2d4b53762609c21507bd3653ec0 Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 2 Mar 2016 09:51:42 +0100 Subject: [PATCH] updated yesod newsfeeed and imagemagick deps --- Handler/RootFeed.hs | 9 ++++----- Handler/Upload.hs | 8 ++++---- Helper.hs | 2 +- eidolon.cabal | 4 ++-- stack.yaml | 4 ++-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Handler/RootFeed.hs b/Handler/RootFeed.hs index 091d2cd..656b241 100755 --- a/Handler/RootFeed.hs +++ b/Handler/RootFeed.hs @@ -190,11 +190,10 @@ mediumToEntry ent = do , feedEntryUpdated = mediumTime (entityVal ent) , feedEntryTitle = mediumTitle (entityVal ent) , feedEntryContent = toHtml (fromMaybe (Textarea "") $ mediumDescription $ entityVal ent) - , feedEntryEnclosure = Just - ( StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview $ entityVal ent) [] - , size - , "image/jpeg" - ) + , feedEntryEnclosure = Just $ EntryEnclosure + (StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview $ entityVal ent) []) + size + "image/jpeg" } getSize :: FilePath -> IO Int diff --git a/Handler/Upload.hs b/Handler/Upload.hs index fdda115..0554f61 100755 --- a/Handler/Upload.hs +++ b/Handler/Upload.hs @@ -128,8 +128,8 @@ generateThumb path userId albumId = do (iWidth, tWidth, pWidth) <- liftIO $ withMagickWandGenesis $ do (_, w) <- magickWand (_, p) <- magickWand - readImage w (decodeString path) - readImage p (decodeString path) + readImage w (T.pack path) + readImage p (T.pack path) w1 <- getImageWidth w h1 <- getImageHeight w let h2 = 230 @@ -144,8 +144,8 @@ generateThumb path userId albumId = do resizeImage p w3 h3 lanczosFilter 1 setImageCompressionQuality w 95 setImageCompressionQuality p 95 - writeImage w (Just (decodeString newPath)) - writeImage p (Just (decodeString prevPath)) + writeImage w (Just (T.pack newPath)) + writeImage p (Just (T.pack prevPath)) return (w1, w2, w3) return (newPath, prevPath, iWidth, tWidth, pWidth) diff --git a/Helper.hs b/Helper.hs index a3db331..61825a8 100755 --- a/Helper.hs +++ b/Helper.hs @@ -194,7 +194,7 @@ getThumbWidth path | path == Nothing = pure 230 | otherwise = liftIO $ withMagickWandGenesis $ do (_, w) <- magickWand - readImage w (decodeString $ fromJust path) + readImage w (T.pack $ fromJust path) getImageWidth w multiFileField :: (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m [FileInfo] diff --git a/eidolon.cabal b/eidolon.cabal index 0de5865..90dae25 100755 --- a/eidolon.cabal +++ b/eidolon.cabal @@ -113,14 +113,14 @@ library , yesod-markdown >= 0.10 , blaze-markup >= 0.7 , wai >= 3.0 - , yesod-newsfeed >= 1.5 + , yesod-newsfeed >= 1.6 , unix >= 2.7 , bloodhound >= 0.8 , http-types -- for Migrations , HDBC , HDBC-postgresql - , imagemagick + , imagemagick >= 0.0.4 , text , filepath , system-filepath diff --git a/stack.yaml b/stack.yaml index 5a46b2b..bc75bca 100644 --- a/stack.yaml +++ b/stack.yaml @@ -107,7 +107,7 @@ extra-deps: - http-date-0.0.6.1 - http-types-0.9 - http2-1.3.1 -- imagemagick-0.0.3.5 +- imagemagick-0.0.4.1 - iproute-1.7.0 - kan-extensions-4.2.3 - keys-3.10.2 @@ -213,7 +213,7 @@ extra-deps: - yesod-core-1.4.18.1 - yesod-form-1.4.6 - yesod-markdown-0.10.0 -- yesod-newsfeed-1.5 +- yesod-newsfeed-1.6 - yesod-persistent-1.4.0.3 - yesod-static-1.5.0.3 - yesod-test-1.5.0.1