'Constructor.
Only one of image_data, blob_key or filename can be specified.
Args:
image_data: str, image data in string form.
blob_key: BlobKey, BlobInfo, str, or unicode representation of BlobKey of
blob containing the image data.
filename: str, the filename of a Google Storage file containing the
image data. Must be in the format \'/gs/bucket_name/object_name\'.
Raises:
NotImageError if the given data is empty.'

def __init__(self, image_data=None, blob_key=None, filename=None):

    if ((not image_data) and (not blob_key) and (not filename)):
        raise NotImageError('Empty    image    data.')
    if (image_data and (blob_key or filename)):
        raise NotImageError('Can    only    take    one    of    image,    blob    key    or    filename.')
    if (blob_key and filename):
        raise NotImageError('Can    only    take    one    of    image,    blob    key    or    filename.')
    self._image_data = image_data
    if filename:
        self._blob_key = blobstore.create_gs_key(filename)
    else:
        self._blob_key = _extract_blob_key(blob_key)
    self._transforms = []
    self._width = None
    self._height = None
    self._format = None
    self._correct_orientation = UNCHANGED_ORIENTATION
    self._original_metadata = None
