Is it possible to trim a pictureframe with Python without losing the picture?

Thanks for reporting the bug Dale and for the help however there is still a problem, your script trim the surface but picture is shrinked not trimed, this is an undesired behavior that dosen’t happend with the manual command. maybe it’s important to specify it in the bug report, I made this graph and hope it explain better the problem :

in the meanwhile if there is another solution I’m interested.