java.lang.AssertionError: Stream with not supported image type: UNKNOWN

Hi aspose Team !!!

I have this code

try
{
    Document documenT = new Document(PropertieLoader.loadPropertie("templatePath"));
    DocumentBuilder builder = new DocumentBuilder(document);
    builder.insertImage(PropertieLoader.loadPropertie("imagePath");
}
catch (Exception e)
{
    e.printStackTrace();
}

But i got this exception

java.lang.AssertionError: Stream with not supported image type: UNKNOWN**
at com.aspose.words.ImageData.a(Unknown Source)
at com.aspose.words.DocumentBuilder.a(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)

if somebody has the solution please help me

THANKS IN ADVANCE !!!

Inserting PNG, JPEG, BMP, EMF and WMF is only supported. What image you are trying to insert?

I’m trying to insert a PNG file

I try with PNG, BMP , JPEG but always i have this java.lang.AssertionError: Stream with not supported image type: UNKNOWN

Thanks In Advance !!!

Hi, BETASCON,
Can you check what a value returns your PropertieLoader?
We have tested java’s DocumentBuilder with emf, wmf, jpeg, png and gif – all works well. Such an assertion error we can get only with tiff files that are really not supported yet.
Please, attach your template word document and some image files that don’t work.
Best Regards,