         4 read endian>
         [ <ifd> push-ifd ] [ 0 = [ read-ifds ] unless ] bi
     ] with-tiff-endianness ;
+
+: read-strips ( ifd -- ifd )
+    dup processed-tags>>
+    [ [ strip-byte-counts instance? ] find nip n>> ]
+    [ [ strip-offsets instance? ] find nip n>> ] bi
+    [ seek-absolute seek-input read ] { } 2map-as >>strips ;
 
 ! ERROR: unhandled-ifd-entry data n ;
 

! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators io io.encodings.binary io.files
kernel pack endian tools.hexdump constructors sequences arrays
sorting.slots math.order math.parser prettyprint ;
IN: graphics.tiff

TUPLE: tiff
endianness
the-answer
ifd-offset
ifds
processed-ifds ;

CONSTRUCTOR: tiff ( -- tiff )
    V{ } clone >>ifds ;

TUPLE: ifd count ifd-entries next ;

CONSTRUCTOR: ifd ( count ifd-entries next -- ifd ) ;



TUPLE: new-subfile-type n ;
CONSTRUCTOR: new-subfile-type ( n -- object ) ;

ERROR: bad-tiff-magic bytes ;

