scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.4k stars 520 forks source link

Bounding boxes are wrongly parsed when shapes are inside a GroupShape #838

Open louisdeneve opened 2 years ago

louisdeneve commented 2 years ago

I'm trying to make a pptx parser script that gives bounding boxes around every part of the slide and label it (Text, Title, List, Table, Figure...). To check my output I draw the boxes on the images of the slide. However I'm seeing a strange behaviour when Shapes are inside of a GroupShape. Do you need to add the shape.left and shape.top of a GroupShape to every Shape inside a GroupShape?

Here you can see a visualization of my output. As you can see, the title box and footer are perfectly alligned. But the GroupShape in the middle seems shifted and I can't figure out where this is coming from. Someone that has a clue? unnamed

Here is an example where there is nothing wrong with the boxes: unnamed

Force1ess commented 1 month ago

925 try this