Package mapproxy :: Package core :: Module image :: Class ImageSource
[hide private]
[frames] | no frames]

Class ImageSource

source code

object --+
         |
        ImageSource

This class wraps either a PIL image, a file-like object, or a file name. You can access the result as an image (as_image ) or a file-like buffer object (as_buffer).
Instance Methods [hide private]
 
__init__(self, source, format='png', size=None, transparent=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
PIL Image
as_image(self)
Returns the image or the loaded image.
source code
file-like object
as_buffer(self, format=None, paletted=None)
Returns the image as a file object.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]
  size

Inherited from object: __class__

Method Details [hide private]

__init__(self, source, format='png', size=None, transparent=False)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • source (PIL Image, image file object, or filename) - the image
  • format - the format of the source
  • size - the size of the source in pixel
Overrides: object.__init__

as_buffer(self, format=None, paletted=None)

source code 
Returns the image as a file object.
Parameters:
  • format - The format to encode an image. Existing files will not be re-encoded.
Returns: file-like object

Property Details [hide private]

size

Get Method:
unreachable.size(self)