anchor.diff:          (strip-byte-counts (get-ifd-values ifd +strip-byte-counts-tag+))
           (compression (get-ifd-value ifd +compression-tag+))
           (planar-configuration (get-ifd-value ifd +planar-configuration-tag+))
  -        (predictor (get-ifd-value ifd +predictor-tag+)))
  +        (predictor (get-ifd-value ifd +predictor-tag+))
  +        image-info
  +        (jpeg-tables (get-ifd-values ifd +jpeg-tables+)))
       (declare (ignore planar-configuration))
  +    (when jpeg-tables
  +      (setf image-info (make-instance 'jpeg-image-info :jpeg-tables jpeg-tables)))
       ;; FIXME
       ;; 1. we need to support predictors for lzw encoded images.
       ;; 2. Presumably we'll want planar images as well at some point.
  
positive.code:          for strip-byte-count across strip-byte-counts
           for row-offset = 0 then (+ row-offset rows-per-strip)
           do (read-rgb-strip stream
                              data
                              row-offset
                              strip-offset
  
negative.code:                         :samples-per-pixel 1 :data data
                          :byte-order *byte-order*)))
        (t
         (error "I can only read 8-, 4-, and 1-bit grayscale images at the moment.")))))
  
  (defun read-rgb-strip (stream image-info array start-row strip-offset
                         strip-byte-count width bits-per-sample samples-per-pixel
                         bytes-per-pixel compression)
    (file-position stream strip-offset)
    (let ((compressed-bytes (read-bytes stream strip-byte-count)))
      (let ((decompressed-bytes (apply (find-compression-decoder compression) compressed-bytes
                                       (when image-info
                                         (list image-info)))))
        (let ((decoded-offset 0))
          (let ((strip-length (/ (length decompressed-bytes) width bytes-per-pixel))
                (bytes-per-sample (/ bytes-per-pixel samples-per-pixel)))
            (loop for i from start-row below (+ start-row strip-length)
               do
                 (let ((rowoff (* i width bytes-per-pixel)))
                   (loop for j below width
                      do
                        (let ((pixoff (+ rowoff (* bytes-per-pixel j))))
                          (loop for k below samples-per-pixel
                             for bits across bits-per-sample
                             do
                               (case bits
                                 (8
                                  (setf (aref array (+ pixoff (* k bytes-per-sample)))
                                        (aref decompressed-bytes decoded-offset))
                                  (incf decoded-offset))
                                 (16
                                  (let ((data-offset (+ pixoff (ash k 1))))
                                    (ecase *byte-order*
                                      (:big-endian
                                       (setf (aref array data-offset)
                                             (aref decompressed-bytes decoded-offset)
                                             (aref array (1+ data-offset))
                                             (aref decompressed-bytes (1+ decoded-offset))))
                                      (:little-endian
                                       (setf (aref array (1+ data-offset))
                                             (aref decompressed-bytes decoded-offset)
                                             (aref array data-offset)
                                             (aref decompressed-bytes (1+ decoded-offset)))))
                                    (incf decoded-offset 2))))))))))))))
  
  (defun read-rgb-image (stream ifd)
    (let ((image-width (get-ifd-value ifd +image-width-tag+))
  