From 495e4ac5a55d7cad6af8e53c61d1366620fa0172 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Wed, 23 Oct 2024 09:13:50 -0500 Subject: [PATCH] Actually make webp --- .gitignore | 1 + demo.scm | 11 +++++++---- graphgif.scm | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f92d835..0e38e9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.png *.gif +*.webp cgif/libguilecgif.so cgif/config.scm diff --git a/demo.scm b/demo.scm index 6d3a48e..4af8be1 100644 --- a/demo.scm +++ b/demo.scm @@ -1,10 +1,13 @@ (use-modules (graphgif) (srfi srfi-9 gnu) - (ice-9 copy-tree)) + (ice-9 copy-tree) + (d-)) (define red (create-color 1 0 0)) (define graph1 (generate-web 10 10)) -(define graph2 (remove-rect (copy-tree graph1) 10 3 3 4 5)) -(assq-set! graph2 0 (set-node-color (assq-ref graph2 0) red)) -(write-graphs-to-file (vector graph1 graph2) "graph.gif") +(define graph2 + (~> (copy-tree graph1) + (remove-rect 10 3 3 4 5) + (remove-rect 10 3 3 6 4))) +(write-graphs-to-file (vector graph1 graph2) "graph.webp") diff --git a/graphgif.scm b/graphgif.scm index bee75f5..5dcd6c4 100644 --- a/graphgif.scm +++ b/graphgif.scm @@ -148,7 +148,8 @@ surface (string-append pngdir "/img-" (number->string i) ".png"))) surfaces) - (system* "ffmpeg" "-i" (string-append pngdir "/img-%d.png") "-r" "1" filename)) + (system* "ffmpeg" "-i" (string-append pngdir "/img-%d.png") + "-r" "1" "-loop" "0" filename)) (define-public (write-graphs-to-file graphs filename) (output-to-file (vector-map (lambda (_ graph) (draw-abstract-graph graph)) graphs) filename))