now base64ing etag hashes for compatibility
This commit is contained in:
parent
647167dd0d
commit
ae567528d5
2 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,7 @@ import Data.Conduit.Binary
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
import qualified Data.ByteString.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
|
import Data.ByteString.Base64
|
||||||
import Graphics.ImageMagick.MagickWand
|
import Graphics.ImageMagick.MagickWand
|
||||||
import qualified Crypto.Hash.SHA3 as SHA3
|
import qualified Crypto.Hash.SHA3 as SHA3
|
||||||
|
|
||||||
|
@ -124,7 +125,7 @@ generateThumb raw = do
|
||||||
setImageCompressionQuality w 95
|
setImageCompressionQuality w 95
|
||||||
setImageFormat w "png"
|
setImageFormat w "png"
|
||||||
getImageBlob w
|
getImageBlob w
|
||||||
let h = SHA3.hash 16 thumb
|
let h = encode (SHA3.hash 8 thumb)
|
||||||
return (thumb, h)
|
return (thumb, h)
|
||||||
|
|
||||||
getGetAvatarR :: AvatarId -> Handler TypedContent
|
getGetAvatarR :: AvatarId -> Handler TypedContent
|
||||||
|
|
|
@ -101,6 +101,7 @@ library
|
||||||
, conduit-extra
|
, conduit-extra
|
||||||
, imagemagick
|
, imagemagick
|
||||||
, cryptohash
|
, cryptohash
|
||||||
|
, base64-bytestring
|
||||||
|
|
||||||
executable yammat
|
executable yammat
|
||||||
if flag(library-only)
|
if flag(library-only)
|
||||||
|
|
Loading…
Reference in a new issue