I’m trying to validate image file using below method:
if (System.IO.File.Exists("D:\\architecture.png"))
{
using (var streams = new FileStream("D:\\architecture.png",FileMode.Open))
{
bIsValid = Aspose.Imaging.Image.CanLoad(streams);
}
}
CanLoad method throws error:
System.ArgumentOutOfRangeException: Non-negative number required. Parameter name: count
How to check valid Image file using stream?
PS: I referred below links but solution found.
https://apireference.aspose.com/net/imaging/aspose.imaging/image/methods/canload
architecture.png (91.8 KB)