Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Image corrupted vs Image not found vs File format not supported

Case 1 Image File Corrupted

Case 2Image File not found in the location

Case 3 Image file format not supported

How do I differentiate between these?

My OpenCV version 3.4.0

I used cv2.imread(filelocation)

When I tried to print the image after using imread

I got the same output None for all the three cases.

I would like to try catch the different scenarios so that I can know exactly where I have an error.

Any suggestion?

Image corrupted vs Image not found vs File format not supported

Case 1 Image File Corrupted

Case 2Image File not found in the location

Case 3 Image file format not supported

How do I differentiate between these?

My OpenCV version 3.4.0

I used cv2.imread(filelocation)

When I tried to print the image after using imread

I got the same output None for all the three cases.

I would like to try catch the different scenarios so that I can know exactly where I have an error.

Any suggestion?

PS: By location I mean a url link. Without using another type of library in python.