go/src/image/gif
Jed Denlea c52aca1c76 image/gif: fix writeImageBlock with SubImages
If an image has been cropped horizontally, writeImageBlock detects that
its width and Stride differ and acts accordingly.

However, if an image has been cropped vertically, trimming from the
bottom, the whole original image will be written in place.  This results
in more data in the LZW stream than necessary, and many decoders
including image/gif's itself will fail to load.

Fixes #20692

Change-Id: Id332877e31bcf3729c89d8a50c1be0464028d82e
Reviewed-on: https://go-review.googlesource.com/45972
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-06-16 05:45:48 +00:00
..
reader.go image/gif: handle an extra data sub-block byte. 2017-03-02 23:49:32 +00:00
reader_test.go image/gif: handle an extra data sub-block byte. 2017-03-02 23:49:32 +00:00
writer.go image/gif: fix writeImageBlock with SubImages 2017-06-16 05:45:48 +00:00
writer_test.go image/gif: fix writeImageBlock with SubImages 2017-06-16 05:45:48 +00:00