From: Bergmann89 Date: Thu, 6 Feb 2014 16:50:40 +0000 (+0100) Subject: * load PNG direct over TLazIntfImage and TLazReaderPNG instead of TPortableNetworkGraphic X-Git-Tag: v3.0.1~4 X-Git-Url: https://git.delphigl.com/?a=commitdiff_plain;h=eec4c8208622e8c3f5aa421cdb1631576d4c08d2;p=glBitmap.git * load PNG direct over TLazIntfImage and TLazReaderPNG instead of TPortableNetworkGraphic --- diff --git a/glBitmap.pas b/glBitmap.pas index 1e95efa..ea47607 100644 --- a/glBitmap.pas +++ b/glBitmap.pas @@ -5751,7 +5751,7 @@ const MAGIC_LEN = 8; PNG_MAGIC: String[MAGIC_LEN] = #$89#$50#$4E#$47#$0D#$0A#$1A#$0A; var - png: TPortableNetworkGraphic; + reader: TLazReaderPNG; intf: TLazIntfImage; StreamPos: Int64; magic: String[MAGIC_LEN]; @@ -5767,27 +5767,20 @@ begin exit; end; - png := TPortableNetworkGraphic.Create; + intf := TLazIntfImage.Create(0, 0); + reader := TLazReaderPNG.Create; try try - png.LoadFromStream(aStream); - intf := png.CreateIntfImage; - try try - AssignFromLazIntfImage(intf); - except - result := false; - aStream.Position := StreamPos; - exit; - end; - finally - intf.Free; - end; + reader.UpdateDescription := true; + reader.ImageRead(aStream, intf); + AssignFromLazIntfImage(intf); except result := false; aStream.Position := StreamPos; exit; end; finally - png.Free; + reader.Free; + intf.Free; end; end;