Could not create the bitmap with the specified parameters. Possible lack of system resources.: Parameter is not valid. FileFormat =0

I met a problem when I insert images into a cell in the word, the method of “insertImage” below throw exception:

Could not create the bitmap with the specified parameters. Possible lack of system resources.: Parameter is not valid. FileFormat =0

table = word.getFirstSection().getBody().getTables().get(1);
builder.moveTo(table.getFirstRow().getCells().get(1).getFirstParagraph());
builder.insertImage(FileLogic.getInputStreamByFileInfo(t.getFileInfo(), user), width, height);

@GusGus Could you please attach the problematic image here for testing? We will check the issue and provide you more informtion.

pic.zip (40.2 KB)

@alexey.noskov these are my pics.

By the way, I am in using the version of “23.9”, here is my pom:

<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-words</artifactId>
	<version>23.9</version>
	<classifier>jdk17</classifier>
</dependency>
<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-words</artifactId>
	<version>23.9</version>
	<classifier>javadoc</classifier>
</dependency>

@GusGus
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26197

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

hi,

I found if the pic had been compressed,it would occur this error. is there any plan to fix it?

@GusGus The issue reported in this topic has been resolved in 24.2 version of Aspose.Words for Java. If you still encounter the problem. Please attach the problematic image here for testing.