# Revision history [back]

@berak Could add this in the comment

I found code few code online using urllib and requests, which solves problem number 2

url='https://'
re=requests.get(url)
print(re.status_code)
if re.status_code == 200:
resp = urllib.request.urlopen(url)


Only part is how do I get the same None value for both corrupted as well as unsupported files that I use to get using imread

@berak Could Couldn't add this in the comment

I found code few code online using urllib and requests, which solves problem number 2

url='https://'
re=requests.get(url)
print(re.status_code)
if re.status_code == 200:
resp = urllib.request.urlopen(url)


Only part is how do I get the same None value for both corrupted as well as unsupported files that I use to get using imread

@berak Couldn't add this in the comment

I found code few code online using urllib and requests, which solves problem number 2

url='https://'
re=requests.get(url)
print(re.status_code)
if re.status_code == 200:
resp = urllib.request.urlopen(url)


Only part is how do I get the same None value for both corrupted as well as unsupported files that I use to get using imread

PS

Found this

imdecode return empty matrix/image if the buffer is short or contains invalid data hopefully None in python

According to this

imread checks if the image cannot be read, then return same as decode empty martix and None in python

How to I add this improper permissions, unsupported or invalid format using python on numpy array of the image I already have?

Or is it not required?

@berak Couldn't add this in the comment

I found code few code online using urllib and requests, which solves problem number 2

url='https://'
re=requests.get(url)
print(re.status_code)
if re.status_code == 200:
resp = urllib.request.urlopen(url)


Only part is how do I get the same None value for both corrupted as well as unsupported files that I use to get using imread

PS

Found this

imdecode return empty matrix/image if the buffer is short or contains invalid data hopefully None in python

According to this

imread checks if the image cannot be read, then return same as decode empty martix and None in python

How to I add this improper permissions, unsupported or invalid format using python on numpy array of the image I already have?

Or is it not required?