factor out a load-tiff word
parent
b93b827fb8
commit
17724be48c
|
@ -271,13 +271,15 @@ ERROR: bad-small-ifd-type n ;
|
||||||
: parsed-tiff>images ( tiff -- sequence )
|
: parsed-tiff>images ( tiff -- sequence )
|
||||||
ifds>> [ ifd>image ] map ;
|
ifds>> [ ifd>image ] map ;
|
||||||
|
|
||||||
! tiff files can store several images -- we just take the first for now
|
: load-tiff ( path -- parsed-tiff )
|
||||||
M: tiff-image load-image* ( path tiff-image -- image )
|
binary [
|
||||||
drop binary [
|
|
||||||
<parsed-tiff>
|
<parsed-tiff>
|
||||||
read-header dup endianness>> [
|
read-header dup endianness>> [
|
||||||
read-ifds
|
read-ifds
|
||||||
dup ifds>> [ process-ifd read-strips strips>buffer drop ] each
|
dup ifds>> [ process-ifd read-strips strips>buffer drop ] each
|
||||||
] with-endianness
|
] with-endianness
|
||||||
] with-file-reader
|
] with-file-reader ;
|
||||||
parsed-tiff>images first ;
|
|
||||||
|
! 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 ;
|
||||||
|
|
Loading…
Reference in New Issue