Comment 1 for bug 309092

Revision history for this message
Daniel Herring (dherring) wrote :

Just hit another rendition of the bug in the wild. Here, SBCL thankfully ignored the bogus byte size (Clisp crashed).

(defun READ-RAW-CANNY-EDGES (file &key (width 640) (height 486))
  (let ((a (make-array (list height width) :element-type 'bit :initial-element 0)))
   (with-open-file (s file :direction :input :element-type '(unsigned-byte 1))
     (loop for i from 0 below height doing
           (loop for j from 0 below width doing
                 (when (= 255 (read-byte s)) (setf (aref a i j) 1)))))
   a))