io.Copy copies zero bytes

The image.Decode(file) reads all contents from file so there is nothing left to read for io.Copy(buf, file).

1 Like