Ejemplo n.º 1
0
 def _pil_props(self):
     """
     A tuple containing useful image properties extracted from this image
     using Pillow (Python Imaging Library, or 'PIL').
     """
     stream = BytesIO(self._blob)
     pil_image = PIL_Image.open(stream)
     format = pil_image.format
     width_px, height_px = pil_image.size
     dpi = pil_image.info.get("dpi")
     stream.close()
     return (format, (width_px, height_px), dpi)
Ejemplo n.º 2
0
def when_open_presentation_stream(context):
    with open(test_pptx("test"), "rb") as f:
        stream = BytesIO(f.read())
    context.prs = Presentation(stream)
    stream.close()
Ejemplo n.º 3
0
def when_open_presentation_stream(context):
    with open(test_pptx('test'), 'rb') as f:
        stream = BytesIO(f.read())
    context.prs = Presentation(stream)
    stream.close()