diff --git a/vendor/vendor.json b/vendor/vendor.json index 6df34f3..baa6b9e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -68,9 +68,11 @@ "revisionTime": "2014-12-02T11:37:49-08:00" }, { + "checksumSHA1": "cBdDkft9ir+lyLbeRQ4zCAoR0AY=", "path": "willnorris.com/go/gifresize", - "revision": "104a7cd64b08d0ebbf2b5c81fa9c99858ba9ee46", - "revisionTime": "2015-12-07T22:25:22-08:00" + "revision": "6a222229fa0697e6da06ec80f8ffd0ada346669d", + "revisionTime": "2016-04-28T23:14:23Z" } - ] + ], + "rootPath": "willnorris.com/go/imageproxy" } diff --git a/vendor/willnorris.com/go/gifresize/gifresize.go b/vendor/willnorris.com/go/gifresize/gifresize.go index cc5f2ed..7461f3b 100644 --- a/vendor/willnorris.com/go/gifresize/gifresize.go +++ b/vendor/willnorris.com/go/gifresize/gifresize.go @@ -55,8 +55,19 @@ func Process(w io.Writer, r io.Reader, transform TransformFunc) error { // Resize each frame. for index, frame := range im.Image { bounds := frame.Bounds() + previous := img draw.Draw(img, bounds, frame, bounds.Min, draw.Over) im.Image[index] = imageToPaletted(transform(img), frame.Palette) + + switch im.Disposal[index] { + case gif.DisposalBackground: + // I'm just assuming that the gif package will apply the appropriate + // background here, since there doesn't seem to be an easy way to + // access the global color table + img = image.NewRGBA(b) + case gif.DisposalPrevious: + img = previous + } } // Set image.Config to new height and width