         [ nip unhandled-ifd-entry swap ]
     } case ;
 
-: process-ifds ( parsed-tiff -- parsed-tiff )
+: process-ifds ( loading-tiff -- loading-tiff )
     [
         [
             dup ifd-entries>>


SINGLETON: tiff-image

TUPLE: parsed-tiff endianness the-answer ifd-offset ifds ;
CONSTRUCTOR: parsed-tiff ( -- tiff ) V{ } clone >>ifds ;

TUPLE: ifd count ifd-entries next
processed-tags strips bitmap ;

: tiff>image ( image -- image )
    ifds>> [ ifd>image ] map first ;

: with-tiff-endianness ( loading-tiff quot -- )
    [ dup endianness>> ] dip with-endianness ; inline

: load-tiff-ifds ( path -- loading-tiff )
    binary [
        <loading-tiff>
        read-header [
            dup ifd-offset>> read-ifds
            process-ifds
