diff --git a/term_image/render_image.go b/term_image/render_image.go index a2af0f2..4985093 100644 --- a/term_image/render_image.go +++ b/term_image/render_image.go @@ -52,18 +52,14 @@ func RenderImage(filepath string, row int, col int) { fmt.Printf("q=2,a=T,f=32,s=%d,v=%d,", width, height) first = false } - remaining := len(encoded) - pos - chunk_len := remaining + chunk_len := len(encoded) - pos if chunk_len > chunk_size { chunk_len = chunk_size } if pos+chunk_len < len(encoded) { - fmt.Print("m=1;") - } else { - fmt.Print(";") + fmt.Print("m=1") } - fmt.Print(encoded[pos : pos+chunk_len]) - fmt.Print("\033\\") + fmt.Printf(";%s\033\\", encoded[pos:pos+chunk_len]) pos += chunk_len } fmt.Print("\033[u")