Glow Effect Barely Visible in Thumbnail for Glow Radius Smaller than 4

The glow effect is barely visible for glow radius value between 1 and 3 in the thumbnail. This significantly differs from the Powerpoint file where you see a clear glow effect in that range. With glow radius 4 and higher, the glow effect is clearly visible in the thumbnail.

Expected behavior: The glow effect in the thumbnail looks the same as it does in the PPTX file.

Tested with Aspose Slides 23.11.

GlowEffectThicknessInThumbnail.png (70.1 KB)

Here is a short Java 17 program to reproduce the behavior.

import com.aspose.slides.*;

import javax.imageio.ImageIO;
import java.awt.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

@SuppressWarnings("CallToPrintStackTrace")
public class GlowEffectThickness {

    public static void main(String[] args) {
        final var presentation = new Presentation();
        final var slide = presentation.getSlides().get_Item(0);

        for (int glowRadius = 0; glowRadius < 7; glowRadius++) {
            addRectangle(slide, glowRadius);
        }

        writeFile("GlowEffectThicknessInThumbnail.png",
                outputStream -> ImageIO.write(slide.getThumbnail(2, 2), "png", outputStream));
        writeFile("GlowEffectThicknessInThumbnail.pptx",
                outputStream -> presentation.save(outputStream, SaveFormat.Pptx));
    }

    private static void addRectangle(final ISlide slide, final int glowRadius) {
        final var bgColor = Color.white;
        final var fgColor = new Color(0x808080);
        final var glowColor = new Color(0xaa0000);

        final var shape = slide.getShapes().addAutoShape(ShapeType.Rectangle,
                280, 135 + glowRadius * 40, 160, 30);

        shape.getTextFrame().getTextFrameFormat().setWrapText(NullableBool.False);
        shape.getTextFrame().setText("Glow radius: " + glowRadius);

        streamTextFramePortions(shape.getTextFrame())
                .map(portion -> portion.getPortionFormat().getFillFormat())
                .forEach(fillFormat -> {
                    fillFormat.setFillType(FillType.Solid);
                    fillFormat.getSolidFillColor().setColor(fgColor);
                });

        shape.getLineFormat().getFillFormat().setFillType(FillType.Solid);
        shape.getLineFormat().getFillFormat().getSolidFillColor().setColor(fgColor);
        shape.getLineFormat().setWidth(1);

        shape.getFillFormat().setFillType(FillType.Solid);
        shape.getFillFormat().getSolidFillColor().setColor(bgColor);

        shape.getEffectFormat().enableGlowEffect();
        shape.getEffectFormat().getGlowEffect().setRadius(glowRadius);
        shape.getEffectFormat().getGlowEffect().getColor().setColor(glowColor);
    }

    private static Stream<IPortion> streamTextFramePortions(ITextFrame textFrame) {
        return StreamSupport.stream(textFrame.getParagraphs().spliterator(), false)
                .flatMap(paragraph -> StreamSupport.stream(paragraph.getPortions().spliterator(), false));
    }

    private static void writeFile(String fileName, FileWriter fileWriter) {
        final File pngFile = new File(fileName);
        try (final FileOutputStream outputStream = new FileOutputStream(pngFile)) {
            System.out.println("Writing file " + pngFile.getAbsolutePath());
            fileWriter.write(outputStream);
        } catch (final IOException e) {
            e.printStackTrace();
        }
    }

    @FunctionalInterface
    public interface FileWriter {
        void write(FileOutputStream fileOutputStream) throws IOException;
    }
}

@pstoehrer,
Thank you for reporting on the issue. I’ve reproduced the problem you described.

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-39371

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.

Please also share the following additional information if it is possible:

  • OS version on which the code was executed
  • JDK version in your app
1 Like

openjdk version “17.0.9” 2023-10-17 LTS
Windows 10 Version 22H2 (Build 19045.3693)

@pstoehrer,
Thank you for the additional information. I’ve added it to the issue ticket.

The issues you found earlier (filed as SLIDESJAVA-39371) have been fixed in Aspose.Slides for Java 24.2 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.