'bitstream' is an array where each element contains 8 bits, i.e. etc. etc.
I want to print out this array to a file so it'll be recognised and can be opened as a jpeg.
I have tried the following:
output = open('outputfile.jpg', 'wb') for i in range(len(bitstream)): output.write(bitstream[i])
bitstreamtoprint = string.join(bitstream, "") output = open('outputfile.jpg', 'wb') for i in range(len(bitstreamtoprint)): output.write(bitstreamtoprint[i])
however neither of these work, they create the file but it won't open as a jpeg, no matter what application I try to open them in. I'm using Windows Vista, and have also tried opening the files in Ubuntu Linux and it does not work on that either - I get an error saying the file is corrupted or that it is not a jpeg.