Bitmap being disposed after calling InsertImage

I’ve got code looping through sections of a document inserting an image into the header of the document. This code works, but for a specific document after calling…

docBuilder.InsertImage(locationLogo, width, height);

Whilst this statement executes fine, after the statement has been executed it seems like the locationLogo bitmap has been disposed, calling any of the properties on the logo results in a ArgumentException with the message “Parameter is not valid.”. On the next iteration of the loop the same statement is executed again with the disposed bitmap and an exception is thrown.

EDIT: I believe it is related to the image being inserted, not the document, after opening the specific jpg image in paint.net and saving it, the issue cannot be replicated. We don’t have control over the images uploaded, the image appears fine when viewed, there’s nothing to indicate that there might be issues using the image in aspose or any other application.

@support-1

Could you please ZIP and attach your input, problematic and expected output Word documents along with code example to reproduce this issue at our end? We will investigate the issue and provide you more information on it.