sad, but impossible with opencv means. all you can do is check for None in python (or empty() in c++)
you can do additional (manual) checks, like f = open(imgpath) for 2. or try to match the first bytes of the file against some 'file magic' list for 3. , but the real hard case is 1., since you'd need to know about the inner structure of the file format , you're trying to read.