mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 02:28:04 +02:00
LCL: Activate writing of grayscale JPEG images. (Issue #30408, patch by Nur Cholif Murtadho)
git-svn-id: trunk@59052 -
This commit is contained in:
parent
c0c477a971
commit
17269a3edf
@ -1764,6 +1764,7 @@ type
|
||||
FProgressiveEncoding: boolean;
|
||||
FQuality: TJPEGQualityRange;
|
||||
procedure SetCompressionQuality(AValue: TJPEGQualityRange);
|
||||
procedure SetGrayScale(AValue: Boolean);
|
||||
protected
|
||||
procedure InitializeReader(AImage: TLazIntfImage; AReader: TFPCustomImageReader); override;
|
||||
procedure InitializeWriter(AImage: TLazIntfImage; AWriter: TFPCustomImageWriter); override;
|
||||
@ -1778,7 +1779,7 @@ type
|
||||
class function GetFileExtensions: string; override;
|
||||
public
|
||||
property CompressionQuality: TJPEGQualityRange read FQuality write SetCompressionQuality;
|
||||
property GrayScale: Boolean read FGrayScale;
|
||||
property GrayScale: Boolean read FGrayScale write SetGrayScale;
|
||||
property ProgressiveEncoding: boolean read FProgressiveEncoding;
|
||||
property Performance: TJPEGPerformance read FPerformance write FPerformance;
|
||||
end;
|
||||
|
@ -91,6 +91,7 @@ begin
|
||||
if not(AWriter is TFPWriterJPEG) then Exit;
|
||||
TFPWriterJPEG(AWriter).ProgressiveEncoding := ProgressiveEncoding;
|
||||
TFPWriterJPEG(AWriter).CompressionQuality := CompressionQuality;
|
||||
TFPWriterJPEG(AWriter).GrayScale := GrayScale;
|
||||
end;
|
||||
|
||||
procedure TJPEGImage.SetCompressionQuality(AValue: TJPEGQualityRange);
|
||||
@ -99,3 +100,10 @@ begin
|
||||
FQuality := AValue;
|
||||
FreeSaveStream;
|
||||
end;
|
||||
|
||||
procedure TJPEGImage.SetGrayScale(AValue: Boolean);
|
||||
begin
|
||||
if FGrayScale = AValue then Exit;
|
||||
FGrayScale := AValue;
|
||||
FreeSaveStream;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user