From 335a84f52e4bda2c632b7eefa43cad63deaa7854 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Mon, 8 Jul 2024 21:54:45 -0700 Subject: [PATCH] use form image size --- txt.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/txt.go b/txt.go index b0177c4..fb00aa7 100644 --- a/txt.go +++ b/txt.go @@ -2,15 +2,14 @@ package main // TODO: -// - image type based on form value -// - also size and quality -// - imgOpt image quality +// - imgOpt image quality for jpeg // - non overlaping image names atomic.int etc // - garbage collector / delete old images from map // - add referer header // - svg support // - incorrect cert support in both markdown and image download // - unify cdp and txt image handlers +// - use goroutiness to process images // - BOG: DomainFromURL always prefixes with http instead of https // reproduces on vsi vms docs // - BUG: markdown table errors @@ -146,7 +145,7 @@ func smallImg(src []byte, imgType string, maxSize, imgOpt int) ([]byte, error) { if err != nil { return nil, fmt.Errorf("image decode problem: %v", err) } - img = resize.Thumbnail(uint(*defImgSize), uint(*defImgSize), img, resize.NearestNeighbor) + img = resize.Thumbnail(uint(maxSize), uint(maxSize), img, resize.NearestNeighbor) var outBuf bytes.Buffer switch imgType { case "png":