I want to write a python program that adds a comment to a jpeg file. I've read that a comment in a jpeg file is signaled by the marker 0xfffe. Thus, can I just open the file and append this marker with whatever comment I want following it? My code looks something like this:
file = open("someimage.jpg", "a+b")
file.write("\xff\xfeCOMMENT")
file.close()
Does it matter if my comment is after the end of file marker (0xffd9)? Thanks!