From 17724be48c5a8d3ba0a4a6126663d5cb0dc632e9 Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Mon, 9 Feb 2009 22:05:44 -0600
Subject: [PATCH] factor out a load-tiff word

---
 extra/images/tiff/tiff.factor | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/extra/images/tiff/tiff.factor b/extra/images/tiff/tiff.factor
index a220475081..4be81af095 100755
--- a/extra/images/tiff/tiff.factor
+++ b/extra/images/tiff/tiff.factor
@@ -271,13 +271,15 @@ ERROR: bad-small-ifd-type n ;
 : parsed-tiff>images ( tiff -- sequence )
     ifds>> [ ifd>image ] map ;
 
-! tiff files can store several images -- we just take the first for now
-M: tiff-image load-image* ( path tiff-image -- image )
-    drop binary [
+: load-tiff ( path -- parsed-tiff )
+    binary [
         <parsed-tiff>
         read-header dup endianness>> [
             read-ifds
             dup ifds>> [ process-ifd read-strips strips>buffer drop ] each
         ] with-endianness
-    ] with-file-reader
-    parsed-tiff>images first ;
+    ] with-file-reader ;
+
+! tiff files can store several images -- we just take the first for now
+M: tiff-image load-image* ( path tiff-image -- image )
+    drop load-tiff parsed-tiff>images first ;