defun convert-to-gif filename optional force if equal subseq filename

1
2
3
4
5
6
7
(defun convert-to-gif (filename &optional force)
(if (equal (subseq filename (- (length filename) 4)) ".gif")
filename
(let ((target (concatenate 'string (subseq filename 0 (- (length filename) 4)) ".gif")))
(or (and (not force) (if (probe-file target) target))
(progn (ccl::run-program "convert" (list filename target) :output t )
target)))))