diff --git a/esi.go b/esi.go index 4e0abde..386f657 100644 --- a/esi.go +++ b/esi.go @@ -42,7 +42,6 @@ import ( "image" "image/color" "io" - "log" ) var ( @@ -66,12 +65,8 @@ func Decode(r io.Reader) (o image.Image, err error) { return o, err } - log.Println(cfg) - bounds := image.Rect(0, 0, cfg.Width, cfg.Height) - log.Println(bounds) - img := image.NewRGBA(bounds) buf.Next(8 + emptyBytes) @@ -183,7 +178,9 @@ func Encode(w io.Writer, img image.Image) error { configByte |= 32 } - _, err = w.Write([]byte{configByte, 0, 0, 0, 0, 0}) + cfgpad := make([]byte, 2+emptyBytes) // 1 byte for config, 1 empty byte, and a number of empty bytes. + cfgpad[0] = configByte + _, err = w.Write(cfgpad) if err != nil { return err } diff --git a/testpattern.png b/testpattern.png new file mode 100644 index 0000000..24a331c Binary files /dev/null and b/testpattern.png differ