Using a WebP Image to Create a Presentation with Aspose.Slides for Java Failed

When I try to run the example of “Create or clone existing slides from templates”, just amend the image “image.jpg” to “image.webp”, the throw NullPointerException.

os:Windows11
version: com.aspose:aspose-slides:24.3:jdk16
code like:


Presentation pres = new Presentation();
try {
    // Sets conditions for background image
    pres.getSlides().get_Item(0).getBackground().setType(BackgroundType.OwnBackground);
    pres.getSlides().get_Item(0).getBackground().getFillFormat().setFillType(FillType.Picture);
    pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat()
            .setPictureFillMode(PictureFillMode.Stretch);
    
    // Loads the image
    IPPImage imgx = pres.getImages().addImage(Files.readAllBytes(Paths.get("image.webp")));
    
    // Adds image to presentation's images collection
    pres.getSlides().get_Item(0).getBackground().getFillFormat().getPictureFillFormat().getPicture().setImage(imgx);
    
    // Writes the presentation to disk
    pres.save("ContentBG_Img.pptx", SaveFormat.Pptx);
} catch (IOException e) {
} finally {
    if (pres != null) pres.dispose();
}

@wiiyaya,
Thank you for describing the issue. Could you kindly compress the “image.webp” file you used into a zip archive and upload it here?

upload_img.zip (1.2 MB)

Pls use this~ thanks!

@wiiyaya,
Thank you for the sample images. Unfortunately, Aspose.Slides does not support WebP format yet.

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): SLIDESJAVA-39428

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.

Thanks for your help!

@wiiyaya,
Thank you for using Aspose.Slides.