0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2025-02-17 23:45:43 -05:00

vendor: update gifresize to 6a22222

Fixes #61
This commit is contained in:
Will Norris 2016-04-28 16:26:31 -07:00
parent 8401001333
commit d825852025
2 changed files with 16 additions and 3 deletions

8
vendor/vendor.json vendored
View file

@ -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"
}

View file

@ -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