(cls, file_stream, size_key, metadata)
return ret
Given the image object and the size key, prepare the metadata calculations
        image_obj: Image object
        file_stream: io.BytesIO stream
        size_key: matching the image_size_map - if original calculate from the original file
        metadata: dict of attachment information taken from the couch _attachments dict
Given the image object and the size key, prepare the metadata calculations
        image_obj: Image object
        file_stream: io.BytesIO stream
        size_key: matching the image_size_map - if original calculate from the original file
        metadata: dict of attachment information taken from the couch _attachments dict
Given the image object and the size key prepare the metadata calculations image_obj : Image object file_stream : io . BytesIO stream size_key : matching the image_size_map - if original calculate from the original file metadata : dict of attachment information taken from the couch _attachments dict
def make_meta(cls, file_stream, size_key, metadata):
        """
        Given the image object and the size key, prepare the metadata calculations
        image_obj: Image object
        file_stream: io.BytesIO stream
        size_key: matching the image_size_map - if original calculate from the original file
        metadata: dict of attachment information taken from the couch _attachments dict
        """
        file_stream.seek(0, os.SEEK_END)
        content_type = None
        for ctype_key in ['content_type', 'Content-Type']:
            content_type = metadata.get(ctype_key, None)
            if content_type is not None:
                break
        if content_type is None:
            content_type = 'application/octet-stream'

        ret = cls(size_key=size_key,
                  content_length=file_stream.tell(),
                  content_type=content_type
        )
        file_stream.seek(0)
        return ret
def make_meta ( cls , file_stream , size_key , metadata ) : file_stream . seek ( 0 , os . SEEK_END ) content_type = None for ctype_key in [ 'content_type' , 'Content-Type' ] : content_type = metadata . get ( ctype_key , None ) if content_type is not None : break if content_type is None : content_type = 'application/octet-stream' ret = cls ( size_key = size_key , content_length = file_stream . tell ( ) , content_type = content_type ) file_stream . seek ( 0 ) return ret