added byte offset from new spec

This commit is contained in:
41666 2017-08-06 17:10:01 -05:00
parent fca2b77d7c
commit c85369cee5

6
esi.go
View file

@ -50,6 +50,8 @@ var (
errNotESI = errors.New("esi: not an esi")
)
var emptyBytes = 7
func init() {
image.RegisterFormat("esi", "esi1", Decode, DecodeConfig)
}
@ -72,7 +74,7 @@ func Decode(r io.Reader) (o image.Image, err error) {
img := image.NewRGBA(bounds)
buf.Next(8)
buf.Next(8 + 7)
for y := bounds.Min.Y; y < bounds.Max.Y; y++ {
for x := bounds.Min.X; x < bounds.Max.X; x++ {
@ -181,7 +183,7 @@ func Encode(w io.Writer, img image.Image) error {
configByte |= 32
}
_, err = w.Write([]byte{configByte, 0})
_, err = w.Write([]byte{configByte, 0, 0, 0, 0, 0, 0, 0, 0})
if err != nil {
return err
}