Adding a comment to an image using PIL
- From: Jeffrey Barish <jeff_barish@xxxxxxxxxxxxx>
- Date: Mon, 30 Oct 2006 20:25:56 -0700
I am trying to use PIL to add a comment to an image. I have never used PIL
before, but I discovered that it is possible to print an existing comment
with the following:
im = PIL.Image.open('filename.jpg')
print im.app['COM']
I figured that I could write a comment by reversing this procedure:
im.app['COM'] = 'New comment'
im.save('newfilename.jpg')
However, when I open newfilename.jpg, I find that key 'COM' does not
exist -- the comment is not being written. Presumably, I am doing
something wrong.
--
Jeffrey Barish
.
- Prev by Date: Re: import in threads: crashes & strange exceptions on dual core machines
- Next by Date: Re: Serious wxPython Error while executing..
- Previous by thread: python, threading and a radio timer
- Next by thread: Re: Adding a comment to an image using PIL
- Index(es):