How to detect only those images in a folder which does not open successfully

I have a folder with set of images, and I have to identify those images which does not open successfully. But few of the files are damaged/not supported to open. There are a mix of extensions like TIF, JPG, PNG etc., I have already tried Uipath methodology and it takes huge time, memory to detect the same as there are millions of images in each folder. So please provide the solution in VBScript, the code should automatically detect those images which opens faultly.

Thanks in advance…

Googling “detect corrupted images” brings up several threads discussing the problem in both and c#. There isn’t going to be a super fast option if you have millions of images. Some solutions will be faster than others but all will take some time to run.