by destel.od:
Below is piece of code from png.Encode function
423 mw, mh := int64(m.Bounds().Dx()), int64(m.Bounds().Dy())
424 if mw <= 0 || mh <= 0 || mw >= 1<<32 || mh >= 1<<32 {
425 return FormatError("invalid image size: " + strconv.FormatInt(mw, 10) +
"x" + strconv.FormatInt(mw, 10))
426 }
Error message does not contain image height, but contains image width twice.