LCL: Activate TJpegImage.ProgressiveEncoding and .Smoothing (issue #30408, patch by Nur Cholif Murtadho).

git-svn-id: trunk@59055 -
This commit is contained in:
wp 2018-09-17 22:27:03 +00:00
parent 5ba5831cbe
commit 4d63f89b51
2 changed files with 12 additions and 1 deletions

View File

@ -1766,8 +1766,10 @@ type
FProgressiveEncoding: boolean;
FQuality: TJPEGQualityRange;
FScale: TJPEGScale;
FSmoothing: Boolean;
procedure SetCompressionQuality(AValue: TJPEGQualityRange);
procedure SetGrayScale(AValue: Boolean);
procedure SetProgressiveEncoding(AValue: Boolean);
protected
procedure InitializeReader(AImage: TLazIntfImage; AReader: TFPCustomImageReader); override;
procedure InitializeWriter(AImage: TLazIntfImage; AWriter: TFPCustomImageWriter); override;
@ -1785,9 +1787,10 @@ type
property GrayScale: Boolean read FGrayScale write SetGrayScale;
property MinHeight: Integer read FMinHeight write FMinHeight;
property MinWidth: Integer read FMinWidth write FMinWidth;
property ProgressiveEncoding: boolean read FProgressiveEncoding;
property ProgressiveEncoding: boolean read FProgressiveEncoding write SetProgressiveEncoding;
property Performance: TJPEGPerformance read FPerformance write FPerformance;
property Scale: TJPEGScale read FScale write FScale;
property Smoothing: Boolean read FSmoothing write FSmoothing;
end;
{$ENDIF}

View File

@ -86,6 +86,7 @@ begin
TFPReaderJPEG(AReader).MinWidth := MinWidth;
TFPReaderJPEG(AReader).Performance := Performance;
TFPReaderJPEG(AReader).Scale := Scale;
TFPReaderJPEG(AReader).Smoothing := Smoothing;
end;
procedure TJPEGImage.InitializeWriter(AImage: TLazIntfImage; AWriter: TFPCustomImageWriter);
@ -110,3 +111,10 @@ begin
FGrayScale := AValue;
FreeSaveStream;
end;
procedure TJPEGImage.SetProgressiveEncoding(AValue: boolean);
begin
if FProgressiveEncoding = AValue then Exit;
FProgressiveEncoding := AValue;
FreeSaveStream;
end;