By the way the png Object is never freed.
Correct. And the 3 streams too.
The code is just in "getting results" stage, so the nonreleasing used memory did not seem so important since in this moment I use the code only for tests in Delphi.
But thank you.
I would fragment the whole procedure into separate procedures. That will make it easier to locate problems and bugs. Your long procedure is way too confusing. And if you use a class you can even avoid passing arguments around.
You could be right, although this code seems simple to me + breaking the code into small procedures affects the overall speed.
@FarAndBeyond
Thank you
I'll have a look.
I've worked with Lazarus a few times, even made a dictionary component. So it's not so new to me.