As my title says how can I correctly delete/replace an image (in my case its in a table in the header)? I can find the inline tag inside the run. what is the way to identify its relations and remove everything correctly? Thanks!
Delete the element containing the image reference and add a new one
A couple complications you might encounter:
Replace image
Not sure everything will work properly if you replace say a PNG with a JPG, so might want to experiment if you're changing the image format.
Might need to adjust size/aspect-ratio afterward depending
Delete and replace
I think this should just work, you just need to make sure you're deleting the right "container" element. Deleting the whole paragraph is probably not a bad idea, or at least the run. Regular lxml methods should work for that.
The relationship and old image part may not go away even though it's orphaned, so if you care about that you may need to dig deeper to identify the relationship too and delete it.
As my title says how can I correctly delete/replace an image (in my case its in a table in the header)? I can find the inline tag inside the run. what is the way to identify its relations and remove everything correctly? Thanks!