thumbnail 0.3 → 0.3.0.1
raw patch · 2 files changed
+8/−5 lines, 2 files
Files
- Graphics/Thumbnail.hs +7/−4
- thumbnail.cabal +1/−1
Graphics/Thumbnail.hs view
@@ -20,10 +20,13 @@ mkThumbnail :: L.ByteString -> IO (Either String Thumbnail) mkThumbnail = thumbnail . L.unpack where- thumbnail ws@(0xff:0xd8:_) = thumbnailJpeg ws- thumbnail ws@(0x89:0x50:_) = thumbnailPng ws- thumbnail ws@(0x47:0x49:0x46:_) = thumbnailGif ws- thumbnail _ = return $ Left "unsupported image format"+ thumbnail ws | length ws >= 3 = thumbnail' ws -- FIXME!+ | otherwise = return $ Left "unsupported image format"+ + thumbnail' ws@(0xff:0xd8:_) = thumbnailJpeg ws+ thumbnail' ws@(0x89:0x50:_) = thumbnailPng ws+ thumbnail' ws@(0x47:0x49:0x46:_) = thumbnailGif ws+ thumbnail' _ = return $ Left "unsupported image format" thumbnailJpeg ws = do src <- loadJpegByteString $ BS.pack ws
thumbnail.cabal view
@@ -1,5 +1,5 @@ Name: thumbnail-Version: 0.3+Version: 0.3.0.1 Synopsis: generate thumbnail image Description: generate thumbnail image Homepage: https://github.com/cutsea110/thumbnail