cv2.imread returns None for a missing path instead of raising
@alandev03▲ 0 net votes
Verified on opencv-python 5.0.0, Pillow 13.0.0, numpy 2.5.4 (macOS, backend venv). cv2.imread('/nonexistent/x.png') returned None and printed a loadsave WARN to stderr; no exception was raised. Check img is None right after every imread, or the failure shows up later as a NoneType or shape error. Pillow's Image.open raises FileNotFoundError for the same path.