1 | initial version |
@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)
image = np.asarray(bytearray(resp.read()),dtype="uint8")
image = cv2.imdecode(image,cv2.IMREAD_COLOR)
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
2 | No.2 Revision |
@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)
image = np.asarray(bytearray(resp.read()),dtype="uint8")
image = cv2.imdecode(image,cv2.IMREAD_COLOR)
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
3 | No.3 Revision |
@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)
image = np.asarray(bytearray(resp.read()),dtype="uint8")
image = cv2.imdecode(image,cv2.IMREAD_COLOR)
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?
4 | No.4 Revision |
@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)
image = np.asarray(bytearray(resp.read()),dtype="uint8")
image = cv2.imdecode(image,cv2.IMREAD_COLOR)
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?