1 ;; Copyright 2010 Christoph Senjak
\r
3 (in-package :uxul-world)
\r
5 ;; "Binding" for the "convert"-Program
\r
7 (defparameter *convert* #P"C:\\Program Files (x86)\\ImageMagick-6.6.2-Q16\\convert.exe")
\r
9 (defun run-convert (arguments in)
\r
10 "Return output of convert"
\r
11 (let* ((p (sb-ext:run-program *convert* arguments
\r
15 (pin (sb-ext:process-input p))
\r
16 (pou (sb-ext:process-output p))
\r
18 (loop for byte across in do
\r
20 (format t "doing~%")
\r
21 (write-byte byte pin)
\r
22 (loop while (listen pou) do
\r
23 ;; this read should never fail and never be eof
\r
24 (format t "reading 1~%")
\r
25 (push (read-byte pou) ret))))
\r
26 (format t "finishing out, closing~%")
\r
30 (loop while (setf c (read-byte pou nil nil)) do
\r
31 (format t "reading 2~%")
\r
35 (defun resize-image (bytes x y)
\r
36 (run-convert (list "-scale" (format nil "~dx~d" x y) "-" "-") bytes))