diff --git a/activity.go b/activity.go index 9684c6e..fa0e19b 100644 --- a/activity.go +++ b/activity.go @@ -138,7 +138,8 @@ func savedonk(url string, name, media string, localize bool) *Donk { data = buf.Bytes() if strings.HasPrefix(media, "image") { - img, err := image.Vacuum(&buf, image.Params{MaxWidth: 2048, MaxHeight: 2048}) + img, err := image.Vacuum(&buf, + image.Params{LimitSize: 4800 * 4800, MaxWidth: 2048, MaxHeight: 2048}) if err != nil { log.Printf("unable to decode image: %s", err) localize = false diff --git a/docs/changelog.txt b/docs/changelog.txt index d56bb6d..a6d100a 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,5 +1,9 @@ changelog +-- next + ++ Don't decode excessively large images and run out of memory. + -- 0.7.7 + Add another retry to workaround pixelfed's general unreliability. diff --git a/go.mod b/go.mod index d8c4e28..a3fff7f 100644 --- a/go.mod +++ b/go.mod @@ -7,5 +7,5 @@ require ( golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 golang.org/x/net v0.0.0-20190620200207-3b0461eec859 humungus.tedunangst.com/r/go-sqlite3 v1.1.3 - humungus.tedunangst.com/r/webs v0.6.2 + humungus.tedunangst.com/r/webs v0.6.3 ) diff --git a/go.sum b/go.sum index 4dfd908..43a5ac7 100644 --- a/go.sum +++ b/go.sum @@ -23,3 +23,5 @@ humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9 humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= humungus.tedunangst.com/r/webs v0.6.2 h1:qnlWTYqhp4d+YKlEEX6bQyyyIf+3ZVw/7YiIAGxHupE= humungus.tedunangst.com/r/webs v0.6.2/go.mod h1:Ho+nmafD/aUWF7LnH+Yl2/b0ob7f2pCkXm4onteWvLE= +humungus.tedunangst.com/r/webs v0.6.3 h1:WoN32ETiAgSfOSonxj47cZmspdbmdTNbwlvVDmEDR+I= +humungus.tedunangst.com/r/webs v0.6.3/go.mod h1:Ho+nmafD/aUWF7LnH+Yl2/b0ob7f2pCkXm4onteWvLE=