]> gitweb.factorcode.org Git - factor.git/commitdiff
images.png: length>> field isnt needed
authorBjörn Lindqvist <bjourne@gmail.com>
Fri, 6 May 2016 19:21:23 +0000 (21:21 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Sat, 7 May 2016 13:07:47 +0000 (15:07 +0200)
chunk length>> is always equal to chunk data>> length

extra/images/png/png.factor

index 3f53e1fce4d2cad91f805a4092db9f4dc93179e8..89c63ab4d60056c28d7e15154a10217544dc5eb2 100644 (file)
@@ -43,7 +43,7 @@ CONSTANT: block-width   { 8 4 4 2 2 1 1 }
     loading-png new
     V{ } clone >>chunks ;
 
-TUPLE: png-chunk length type data ;
+TUPLE: png-chunk type data ;
 
 : <png-chunk> ( -- png-chunk )
     png-chunk new ; inline
@@ -62,7 +62,7 @@ ERROR: bad-checksum ;
 
 : read-png-chunks ( loading-png -- loading-png )
     <png-chunk>
-    4 read be> [ >>length ] [ 4 + ] bi
+    4 read be> 4 +
     read dup crc32 checksum-bytes
     4 read = [ bad-checksum ] unless
     4 cut-slice