Package email :: Package mime :: Module image :: Class MIMEImage
[hide private]
[frames] | no frames]

_ClassType MIMEImage

      message.Message --+        
            base.MIMEBase --+    
nonmultipart.MIMENonMultipart --+

Class for generating image/* type MIME documents.

Instance Methods [hide private]
__init__(self, _imagedata, _subtype=None, _encoder=<function encode_base64 at 0x41486fb4>, **_params)
Create an image/* type MIME document.

Inherited from nonmultipart.MIMENonMultipart: attach

Inherited from message.Message: __contains__, __delitem__, __getitem__, __len__, __setitem__, __str__, add_header, as_string, del_param, get, get_all, get_boundary, get_charset, get_charsets, get_content_charset, get_content_maintype, get_content_subtype, get_content_type, get_default_type, get_filename, get_param, get_params, get_payload, get_unixfrom, has_key, is_multipart, items, keys, replace_header, set_boundary, set_charset, set_default_type, set_param, set_payload, set_type, set_unixfrom, values

Inherited from message.Message (private): _get_params_preserve

Imports: walk

Method Details [hide private]

__init__(self, _imagedata, _subtype=None, _encoder=<function encode_base64 at 0x41486fb4>, **_params)


Create an image/* type MIME document.

_imagedata is a string containing the raw image data. If this data can be decoded by the standard Python `imghdr' module, then the subtype will be automatically included in the Content-Type header. Otherwise, you can specify the specific image subtype via the _subtype parameter.

_encoder is a function which will perform the actual encoding for transport of the image data. It takes one argument, which is this Image instance. It should use get_payload() and set_payload() to change the payload to the encoded form. It should also add any Content-Transfer-Encoding or other headers to the message as necessary. The default encoding is Base64.

Any additional keyword arguments are passed to the base class constructor, which turns them into parameters on the Content-Type header.

Overrides: message.Message.__init__