first working version

This commit is contained in:
2026-09-06 03:48:12 +02:00
parent 69498110ed
commit d0d34beb44
3 changed files with 152 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package main
import (
"fmt"
"os/exec"
)
func OptimizeImage(path string) {
fmt.Println("optiimg")
cmd := exec.Command("mogrify",
"-strip",
"-interlace", "Plane",
"-sampling-factor", "4:2:0",
"-resize", "5000x3000",
"-quality", "80%",
path,
)
out, err := cmd.CombinedOutput()
if err != nil {
fmt.Printf("Error optimizing %s: %v\n%s", path, err, out)
} else {
markTouched(path)
fmt.Printf("Optimized %s\n", path)
}
}