summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2014-04-12 10:04:02 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2014-04-12 10:04:02 -0400
commit202a1a1b9f07994138de669f4d8b42b4c0bddcc2 (patch)
treed7e063cb57c687fb0568903e55ed4e51161777fb
parente1bcc7e26babddc80e209b9ce9cb283ef6fa3e33 (diff)
Ivan Daniluk's patch to compress images more quickly.
-rw-r--r--util.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.go b/util.go
index 96ffd9b..22604bd 100644
--- a/util.go
+++ b/util.go
@@ -69,7 +69,7 @@ func bufferFromReader(r io.Reader) (b *bytes.Buffer, err error) {
// Returns a zlib-compressed copy of the specified byte array
func sliceCompress(data []byte) []byte {
var buf bytes.Buffer
- cmp := zlib.NewWriter(&buf)
+ cmp, _ := zlib.NewWriterLevel(&buf, zlib.BestSpeed)
cmp.Write(data)
cmp.Close()
return buf.Bytes()