Converting MHTML file with GIF background results in exceptions in Aspose.Words for Java

Aspose.Words for Java version: com.aspose:aspose-words:21.6:jdk17

Attempting to convert an MHTML file that has a GIF background image to Word results in the following exception…

java.lang.IllegalStateException: Not expected other image formats here.
  at com.aspose.words.zzZhH.zzWXs(Unknown Source)
  at com.aspose.words.zzYzz.zzlx(Unknown Source)
  at com.aspose.words.zzYzz.zzWXs(Unknown Source)
  at com.aspose.words.zzWzE.zzGf(Unknown Source)
  at com.aspose.words.zzzZ.zzWXs(Unknown Source)
  at com.aspose.words.zzzZ.zzWXs(Unknown Source)
  at com.aspose.words.zzYf7.zzX5D(Unknown Source)
  at com.aspose.words.zzYf7.zzYKP(Unknown Source)
  at com.aspose.words.zzYf7.zzWXs(Unknown Source)
  at com.aspose.words.zzW4Z.zzWXs(Unknown Source)
  at com.aspose.words.Document.zzYl6(Unknown Source)
  at com.aspose.words.Document.zzWXs(Unknown Source)
  at com.aspose.words.Document.save(Unknown Source)
  at com.aspose.words.Document.save(Unknown Source)

The attached zip file contains an MHTML file that be used with the example code below to reproduce the issue.
input_mht_background.mht.zip (12.5 KB)

public class MHTBackgroundBug {
    public static void main(String[] args) {
        try {
            // Set to the path of your Aspose license file or comment out
            License pdfLicense = new License();
            pdfLicense.setLicense("aspose.lic");

            LoadOptions mhtLoadOptions = new LoadOptions();
            mhtLoadOptions.setLoadFormat(LoadFormat.MHTML);

            // Open input MHTML file
            Document inputDoc = new Document("input_mht_background.mht", mhtLoadOptions);

            // Save as Word
            inputDoc.save("output_mht_background.doc");

        } catch(Exception ex) {
            System.err.printf("An exception occurred: %s%n", ex.getLocalizedMessage());
            ex.printStackTrace();
            System.exit(1);
        }
    }
}

@rgabbard I was managed to reproduce your issue on my side. I have logged it as WORDSNET- 24088 in our defect tracking system. We will keep you informed and let you know once it is resolved.

The issues you have found earlier (filed as WORDSNET-24088) have been fixed in this Aspose.Words for Java 22.8 update also available on Maven.