I use Delphi Seattle.
My customer loads pictures in database using Devexpress TcxImage component.
In this component they can "paste" pictures from a browser.
Later I need to make thumbnail picture of this. And this is the problem:
-my "thumbnail creation" procedure is for jpg image
-so it works well if it is a jpg but I get Jpeg error #53 if it is a png picture
Question: how can I detect at the beginning if it is a png picture (remember that I cannot know it if the customer uses paste from a browser) and how can I transform it in jpg image?
Thank you very much!
Delphi
Last Comment
Sinisa Vuk
8/22/2022 - Mon
David Favor
Just check the file extension for .png or .jpg/.jpeg + run the correct thumbnail generation code, per file extension.
Member_2_7965240
ASKER
Hi,
In the database I store it as a blob field, so as I don't store the file name, just the picture itself.
A fragment of such a picture in the database:
˙Ř˙ŕJFIF˙ŰC (B+(%%(Q:=0B`Ued_U][jx™jqs[]…µ†