How do I take an image and turn that into binary image data?
This is what I have tried:
class get_binary_data(image_url):
#Get the image online online_image = http://www.myimg.com/test.jpg
online_image = requests.get(image_url).content
image_data = BytesIO(online_image)
However this does not seem to give me the binary image data, could someone help explain the process of getting the binary image data?
This is what I'm trying to do:
app = subprocess.Popen("externalApp",
in=subprocess.PIPE,
out=subprocess.PIPE)
app.in.write(image_data)
app.in.close()
which gives me the error:
IOError: [Errno 32] Broken pipe
.contentisn't the binary image data? What is it instead? What are you doing withimage_datathat's giving you the error message? Don't show us an error message without the code that produced it.