Thanks for writing this nice patch, @pjoyez! I have applied your patch to the latest svn and I get clear images. debug-convert tells me gs
is being used. It would good to know what output @hamorabi is getting.
I do get an error from the line (test-version-num "inkscape -V" "Inkscape " 0.92)
. Executing inkscape -v
returns 1.2 (dc2aedaf03, 2022-05-15)
, which doesn’t work with the function.
Perhaps something like this could work?
(define (all-ints? l)
(if (null? l) #t
(and-with f (string->number (car l))
(if (integer? f) (all-ints? (cdr l)) #f))))
(define (test-version-num cmd key minv1 minv2)
(with a (eval-system cmd)
(if (string-null? a)
#f
(with st (if (string-null? key)
0 (string-search-forwards key 0 a))
(if (== st -1)
#f
(let*
((a (string-split (substring a st) #\space))
(a (map (lambda s (string-split (car s) #\.)) a))
(a (filter all-ints? a))
(v1 (string->number (first (car a))))
(v2 (string->number (second (car a)))))
(or (> v1 minv1)
(and (== v1 minv1) (>= v2 minv2)))))))))