mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 03:59:13 +02:00
* Applied patch from Daniel Gaspary to add compression level to individual items (Bug 20322)
git-svn-id: trunk@19173 -
This commit is contained in:
parent
935a030dca
commit
e0f458a7e9
@ -261,6 +261,7 @@ Type
|
|||||||
FOS: Byte;
|
FOS: Byte;
|
||||||
FSize: Integer;
|
FSize: Integer;
|
||||||
FStream: TStream;
|
FStream: TStream;
|
||||||
|
FCompressionLevel: TCompressionlevel;
|
||||||
function GetArchiveFileName: String;
|
function GetArchiveFileName: String;
|
||||||
Protected
|
Protected
|
||||||
Property HdrPos : Longint Read FHeaderPos Write FheaderPos;
|
Property HdrPos : Longint Read FHeaderPos Write FheaderPos;
|
||||||
@ -277,6 +278,7 @@ Type
|
|||||||
Property DateTime : TDateTime Read FDateTime Write FDateTime;
|
Property DateTime : TDateTime Read FDateTime Write FDateTime;
|
||||||
property OS: Byte read FOS write FOS;
|
property OS: Byte read FOS write FOS;
|
||||||
property Attributes: LongInt read FAttributes write FAttributes;
|
property Attributes: LongInt read FAttributes write FAttributes;
|
||||||
|
Property CompressionLevel: TCompressionlevel read FCompressionLevel write FCompressionLevel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TZipFileEntries }
|
{ TZipFileEntries }
|
||||||
@ -1345,6 +1347,7 @@ Function TZipper.CreateCompressor(Item : TZipFileEntry; AInFile,AZipStream : TSt
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=TDeflater.Create(AinFile,AZipStream,FBufSize);
|
Result:=TDeflater.Create(AinFile,AZipStream,FBufSize);
|
||||||
|
(Result as TDeflater).CompressionLevel:=Item.CompressionLevel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TZipper.ZipOneFile(Item : TZipFileEntry);
|
Procedure TZipper.ZipOneFile(Item : TZipFileEntry);
|
||||||
@ -1983,6 +1986,7 @@ begin
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
FOS := OS_FAT;
|
FOS := OS_FAT;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
FCompressionLevel:=cldefault;
|
||||||
inherited create(ACollection);
|
inherited create(ACollection);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user