Delphi - PNGImage - PNG format issue

Hi there,

Please know that I do not know Delphi.

I have an application programmed in Delphi, that uses PNGImage.  Not from the one included in the most up to date Delphi but the one found in the following website: "".

I am starting to have issues.  I am getting the following error: "The file being readed is not a valid "Portable Network Graphics" image because it contains an invalid header. This file may be corruped, try obtaining it again"

This application converts PNG files into PDF files.  These PNG image files were fine until I had JPEG converted to PNG.

I tested the converted PNG files with TwealPNG and they are all fine, with apparently a proper header.

-If you know what is causing this issue, can you please provide the tweek so my programmer (that has no clue how to deal with this) can implement it in Delphi?
-Is there a way, command line with a tool (to run in a batch file which I am kind a good in) where I can match the PNG format/header of the converted JPEG files to the proper format/header of the PNG file so that it actually works?

Thanks for you feedbacks, help and suggestions.

LVL 10
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Which Delphi version do you have?
With this FREE library, Delphi programs can read and write BMP, ICO, CUR, PNG, MNG, PCX, TIFF and JPEG 2000 bitmaps:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ReneGeAuthor Commented:
Good morning peter,

Thanks for your prompt reply.

I'll look at it and come back to you very shortly.

OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Sinisa VukSoftware architectCommented:
You can try SynGdiPlus units with fast png reading and conversion.
ReneGeAuthor Commented:
By using XN Resource Editor:
RCData -> DVCLAL -> A2 8C DF 98 7B 3C 3A 79 26 71 3F 09 0F 2A 25 17
According to
It was compiled using Delphi Version 3

I'll look at it and come back to you very shortly.

ReneGeAuthor Commented:
Thanks for all your help :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.