mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-02-17 23:45:43 -05:00
parent
8401001333
commit
d825852025
2 changed files with 16 additions and 3 deletions
8
vendor/vendor.json
vendored
8
vendor/vendor.json
vendored
|
@ -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"
|
||||
}
|
||||
|
|
11
vendor/willnorris.com/go/gifresize/gifresize.go
generated
vendored
11
vendor/willnorris.com/go/gifresize/gifresize.go
generated
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue