Decoding email attachments.

Tim Roberts timr at
Sun Nov 9 08:56:30 CET 2003

Thomas Williams <tom_williams_2000_ca at> wrote:
>When I use this line jpg attachment, come out darker
>that it's suppose to be. 
>filelne = filelne + base64.decodestring(line)

Compared to what?

I can think of two possibilities.  Image applications do color management
differently.  So, for example, a JPEG viewed in Microsoft's default image
viewer wil look different from the same JPEG viewed in Photoshop.

Alternately, if you're running Windows, you might be writing the file out
in text-mode instead of using  open('xxx.jpg','wb') to write it in binary.
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list