diff --git a/components/iconfinder/source/iconthumbnails.pas b/components/iconfinder/source/iconthumbnails.pas index 48813ed76c..5035180bd4 100644 --- a/components/iconfinder/source/iconthumbnails.pas +++ b/components/iconfinder/source/iconthumbnails.pas @@ -18,8 +18,8 @@ unit IconThumbNails; interface uses - Classes, SysUtils, fgl, contnrs, FPImage, StrUtils, LazLoggerBase, - laz2_dom, laz2_xmlread, laz2_xmlwrite, + Classes, SysUtils, fgl, contnrs, FPImage, FPReadBMP, StrUtils, LazLoggerBase, + laz2_dom, laz2_xmlread, laz2_xmlwrite, IntfGraphics, FileUtil, LazFileUtils, Graphics, Controls, Dialogs, Menus, Forms, IconFinderStrConsts, BasicThumbnails; @@ -267,6 +267,8 @@ begin begin x := (Viewer.ThumbnailWidth - pic.Width) div 2; y := (Viewer.ThumbnailHeight - pic.Height) div 2; + if Assigned(pic.Bitmap) then + pic.Bitmap.Transparent := true; ACanvas.Draw(ARect.Left + x, ARect.Top + y, pic.Bitmap); end; end; @@ -1149,6 +1151,11 @@ begin reader := TFPCustomImage.FindReaderFromStream(stream); if reader <> nil then begin + {$if FPC_FullVersion < 30301} + // Workaround for FPReaderBMP not implementing "ImageSize" + if reader = TFPReaderBMP then + reader := TLazReaderBMP; + {$ifend} stream.Position := 0; with reader.ImageSize(stream) do begin diff --git a/lcl/intfgraphics.pas b/lcl/intfgraphics.pas index c865aebf28..f7af1a5abd 100644 --- a/lcl/intfgraphics.pas +++ b/lcl/intfgraphics.pas @@ -5091,6 +5091,7 @@ begin end; {$IF FPC_FullVersion < 30301} +{ Workaround for TFPReaderBMP not implementing InternalSize in FPC before 3.3.1} class function TLazReaderBMP.InternalSize (Stream: TStream): TPoint; var fileHdr: TBitmapFileHeader;