Hello all,
I have a simple app that grabs a random image from a folder and displays it using a TImage upon pressing a button.
I have a group of images I would like to use, but they were all .webp. I used a batch script (listed below for anyone curious) to just replace all the extensions to .png, perhaps a bit naively.
@ECHO OFF
PUSHD .
FOR /R %%d IN (.) DO (
cd "%%d"
IF EXIST *.webp (
REN *.webp *.png
)
)
POPD
That worked fine, but whenever my app tries to assign one of the .pngs to the TImage via Picture.LoadFromFile, I get an FPImageException exception, which is actually a different exception than if I try and load an actual .webp, which throws an EInvalidGraphic exception.
Is there some leftover .webp metadeta that's causing this? Is there a better way I should be converting the image extensions to work better with TImage?