From 932dc3539f3966c50ad2514c761f1be9ca286ad9 Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 19 Aug 2015 07:47:23 +0200 Subject: [PATCH] forcing Thumbnails into jpeg format --- Handler/Upload.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Handler/Upload.hs b/Handler/Upload.hs index 6b35bd5..9bdec6e 100644 --- a/Handler/Upload.hs +++ b/Handler/Upload.hs @@ -126,13 +126,14 @@ postDirectUploadR albumId = do generateThumb :: FP.FilePath -> UserId -> AlbumId -> Handler (FP.FilePath, Int, Int) generateThumb path userId albumId = do - newName <- return $ (FP.takeBaseName path) ++ "_thumb" ++ (FP.takeExtension path) + newName <- return $ (FP.takeBaseName path) ++ "_thumb.jpg" newPath <- return $ "static" FP. "data" FP. (T.unpack $ extractKey userId) FP. (T.unpack $ extractKey albumId) FP. newName (iWidth, tWidth) <- liftIO $ withMagickWandGenesis $ do (_ , w) <- magickWand + setImageFormat w "jpeg" readImage w (decodeString path) w1 <- getImageWidth w h1 <- getImageHeight w