From f4b8fd8b97318793d8182de193f1a005cc356664 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 5 Jun 2019 02:13:01 -0400 Subject: [PATCH] better image toolkit for prettier screenshots --- activity.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- honk.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/activity.go b/activity.go index 8187b5e..ebdcbc3 100644 --- a/activity.go +++ b/activity.go @@ -234,7 +234,7 @@ func savedonk(url string, name, media string, localize bool) *Donk { data = buf.Bytes() if strings.HasPrefix(media, "image") { - img, err := image.Vacuum(&buf) + img, err := image.Vacuum(&buf, image.Params{MaxWidth: 2048, MaxHeight: 2048}) if err != nil { log.Printf("unable to decode image: %s", err) localize = false diff --git a/go.mod b/go.mod index 8c377fa..9709678 100644 --- a/go.mod +++ b/go.mod @@ -6,5 +6,5 @@ require ( golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f golang.org/x/net v0.0.0-20190522155817-f3200d17e092 // indirect humungus.tedunangst.com/r/go-sqlite3 v1.1.3 - humungus.tedunangst.com/r/webs v0.4.4 + humungus.tedunangst.com/r/webs v0.5.1 ) diff --git a/go.sum b/go.sum index ee5be57..fdf63c1 100644 --- a/go.sum +++ b/go.sum @@ -16,5 +16,5 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9ga8k38geUI= humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= -humungus.tedunangst.com/r/webs v0.4.4 h1:uK1YW+eGQ0JADiSs7Ipt0ljFfQw7e73924wMm4V3gss= -humungus.tedunangst.com/r/webs v0.4.4/go.mod h1:79Ww3HmgE1m+HXU0r0b9hkOD3JuDzXoGiEauHuKcwBI= +humungus.tedunangst.com/r/webs v0.5.1 h1:I57oIU/ZkKclixRtXs0nJQUWe3Gq+9QVqL7BtV2vzAA= +humungus.tedunangst.com/r/webs v0.5.1/go.mod h1:79Ww3HmgE1m+HXU0r0b9hkOD3JuDzXoGiEauHuKcwBI= diff --git a/honk.go b/honk.go index 46a015a..76bb5c0 100644 --- a/honk.go +++ b/honk.go @@ -874,7 +874,7 @@ func savehonk(w http.ResponseWriter, r *http.Request) { data := buf.Bytes() xid := xfiltrate() var media, name string - img, err := image.Vacuum(&buf) + img, err := image.Vacuum(&buf, image.Params{MaxWidth: 2048, MaxHeight: 2048}) if err == nil { data = img.Data format := img.Format