Browse Source

* Reset resets stream to beginning to zstream, not beginning of file.
* Readpng resets source stream to start of zstream before creating
Tdecompressionstream, rather than seek the decompression stream.

git-svn-id: trunk@9377 -

daniel 17 years ago
parent
commit
10796b2d84
2 changed files with 2 additions and 2 deletions
  1. 1 1
      packages/fcl-image/src/fpreadpng.pp
  2. 1 1
      packages/paszlib/src/zstream.pp

+ 1 - 1
packages/fcl-image/src/fpreadpng.pp

@@ -803,9 +803,9 @@ begin
       ReadChunk;
       ReadChunk;
       HandleChunk;
       HandleChunk;
       end;
       end;
+    ZData.position:=0;
     Decompress := TDecompressionStream.Create (ZData);
     Decompress := TDecompressionStream.Create (ZData);
     try
     try
-      Decompress.position := 0;
       DoDecompress;
       DoDecompress;
     finally
     finally
       Decompress.Free;
       Decompress.Free;

+ 1 - 1
packages/paszlib/src/zstream.pp

@@ -309,9 +309,9 @@ procedure Tdecompressionstream.reset;
 var err:smallint;
 var err:smallint;
 
 
 begin
 begin
+  source.seek(-compressed_read,sofromcurrent);
   raw_read:=0;
   raw_read:=0;
   compressed_read:=0;
   compressed_read:=0;
-  source.position:=0;
   inflateEnd(Fstream);
   inflateEnd(Fstream);
   if skipheader then
   if skipheader then
     err:=inflateInit2(Fstream,-MAX_WBITS)
     err:=inflateInit2(Fstream,-MAX_WBITS)