예제 #1
0
파일: image.py 프로젝트: scanny/python-pptx
 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)
예제 #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()
예제 #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()