mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 12:12:47 +02:00
Gtk2: fixed bitmap creation when ratio DataSize/MaskSize have remainder. issue #41070
This commit is contained in:
parent
1cedb15355
commit
ea838aa496
@ -341,8 +341,8 @@ begin
|
|||||||
Inc(DstRowPtr, Rowstride);
|
Inc(DstRowPtr, Rowstride);
|
||||||
Dec(y);
|
Dec(y);
|
||||||
end;
|
end;
|
||||||
end
|
end else
|
||||||
else begin
|
begin
|
||||||
// components are in place
|
// components are in place
|
||||||
|
|
||||||
// gtkPixbuf doesn't like invalid dataSize/MaskSize < 32. issue #8553.
|
// gtkPixbuf doesn't like invalid dataSize/MaskSize < 32. issue #8553.
|
||||||
@ -352,7 +352,7 @@ begin
|
|||||||
ADivResult := 0;
|
ADivResult := 0;
|
||||||
ARemainder := 0;
|
ARemainder := 0;
|
||||||
DivMod(ARawImage.DataSize, ARawImage.MaskSize, ADivResult, ARemainder);
|
DivMod(ARawImage.DataSize, ARawImage.MaskSize, ADivResult, ARemainder);
|
||||||
CreateWithAlpha := ARemainder = 0;
|
CreateWithAlpha := (ARemainder = 0) and ARawImage.IsMasked(True);
|
||||||
{$IFDEF VerboseRawImage}
|
{$IFDEF VerboseRawImage}
|
||||||
if not CreateWithAlpha then
|
if not CreateWithAlpha then
|
||||||
DebugLn('TGtk2WidgetSet.CreateBitmapFromRawImage B WARNING: This image have invalid DataSize / MaskSize.');
|
DebugLn('TGtk2WidgetSet.CreateBitmapFromRawImage B WARNING: This image have invalid DataSize / MaskSize.');
|
||||||
|
Loading…
Reference in New Issue
Block a user