@Thinian
Please try using the following code to set the width and height of shape’s xform and image.
If there are still issues, please provide the template file and code that generated the problem.
We will look into it.
shape.getXForm().getPinX().setValue(1);
shape.getXForm().getPinY().setValue(1);
shape.getXForm().getWidth().setValue(2);
shape.getXForm().getHeight().setValue(2);
shape.getForeign().getImgWidth().setValue(2);
shape.getForeign().getImgHeight().setValue(2);
Thanks.