diff --git a/examples/simple_example.py b/examples/simple_example.py index 7e05079..6a7d3a3 100644 --- a/examples/simple_example.py +++ b/examples/simple_example.py @@ -63,8 +63,6 @@ def main(): EXAMPLE_DIR / "images" / "python-logo.png", left=(50, "pt"), top=(100, "pt"), - width=(300, "pt"), - height=(80, "pt"), ) .text( "The Python logo", diff --git a/src/tppt/pptx/shape/picture.py b/src/tppt/pptx/shape/picture.py index 6a5af5b..a64477d 100644 --- a/src/tppt/pptx/shape/picture.py +++ b/src/tppt/pptx/shape/picture.py @@ -1,17 +1,22 @@ -from typing import IO, Literal, NotRequired, assert_never +from typing import IO, Literal, NotRequired, TypedDict, assert_never from pptx.opc.constants import CONTENT_TYPE from pptx.shapes.picture import Movie as PptxMovie from pptx.shapes.picture import Picture as PptxPicture -from tppt.types import FilePath +from tppt.types import FilePath, Length, LiteralLength from . import BaseShape, RangeProps -class PictureProps(RangeProps): +class PictureProps(TypedDict): """Picture properties.""" + left: Length | LiteralLength + top: Length | LiteralLength + width: NotRequired[Length | LiteralLength] + height: NotRequired[Length | LiteralLength] + class PictureData(PictureProps): """Picture data."""