From 0e9f93f561edb31a90c887f9a0190d743ee9c34d Mon Sep 17 00:00:00 2001 From: James Date: Mon, 2 Mar 2026 06:01:28 -0500 Subject: [PATCH] chore: auto-commit uncommitted changes --- main.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 75a3f19..190f765 100644 --- a/main.go +++ b/main.go @@ -134,12 +134,14 @@ func captureHandler(w http.ResponseWriter, r *http.Request) { return } - // Resize to 50% using sips - if out, err := exec.Command("sips", "-g", "pixelWidth", tmpFile).Output(); err == nil { - re := regexp.MustCompile(`pixelWidth:\s*(\d+)`) - if m := re.FindSubmatch(out); m != nil { - if w, _ := strconv.Atoi(string(m[1])); w > 0 { - exec.Command("sips", "--resampleWidth", strconv.Itoa(w/2), tmpFile).Run() + // Resize to 50% unless full resolution requested + if r.URL.Query().Get("full") != "1" { + if out, err := exec.Command("sips", "-g", "pixelWidth", tmpFile).Output(); err == nil { + re := regexp.MustCompile(`pixelWidth:\s*(\d+)`) + if m := re.FindSubmatch(out); m != nil { + if w, _ := strconv.Atoi(string(m[1])); w > 0 { + exec.Command("sips", "--resampleWidth", strconv.Itoa(w/2), tmpFile).Run() + } } } }