This is caused by hasSize field in ShapeBase class which is set when decoding the image size. However, when SetWidth and SetHeight methods are called before the size is initialized the value of hasSize is false which causes the issue. Workaround: Call the Size property getter before calling SetWidth/SetHeight method. See the code below: // This line workarounds the issue with SetWidth method which does not get the correct size when locking aspect ratio. Size size = imageInline.Image.Size; imageInline.Image.SetWidth(true, width);