From e759f8f1ba229dc9ab4b7bc7d805485a85e9cf74 Mon Sep 17 00:00:00 2001 From: foglar Date: Tue, 27 May 2025 14:24:24 +0200 Subject: [PATCH] maxini optimalizini --- term_image/render_image.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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")