From 704da0a306539eb5902c2e9385d84f5c47bcb3d8 Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Fri, 5 Nov 2021 13:46:18 +0000 Subject: FOP-3032: Embed pdf into afp using unique type git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1894760 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/render/afp/AFPImageHandlerRawStream.java | 2 +- .../afp/AFPImageHandlerRawStreamTestCase.java | 8 ++++---- fop/lib/xmlgraphics-commons-svn-trunk.jar | Bin 674612 -> 674647 bytes 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java b/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java index 36e5a9db2..cc072e318 100644 --- a/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java +++ b/fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java @@ -44,7 +44,7 @@ public class AFPImageHandlerRawStream extends AbstractAFPImageHandlerRawStream { ImageFlavor.RAW_JPEG, ImageFlavor.RAW_TIFF, ImageFlavor.RAW_EPS, - ImageFlavor.RAW + ImageFlavor.RAW_PDF }; /** logging instance */ diff --git a/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerRawStreamTestCase.java b/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerRawStreamTestCase.java index 9a9ea8558..36460ae0d 100644 --- a/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerRawStreamTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerRawStreamTestCase.java @@ -19,16 +19,15 @@ package org.apache.fop.render.afp; import java.io.InputStream; +import java.util.Arrays; import org.junit.Assert; import org.junit.Test; import org.apache.xmlgraphics.image.loader.ImageFlavor; -import org.apache.xmlgraphics.image.loader.MimeEnabledImageFlavor; import org.apache.xmlgraphics.image.loader.impl.ImageRawStream; import org.apache.fop.afp.AFPPaintingState; -import org.apache.fop.apps.MimeConstants; public class AFPImageHandlerRawStreamTestCase { @Test @@ -36,8 +35,9 @@ public class AFPImageHandlerRawStreamTestCase { AFPPaintingState state = new AFPPaintingState(); state.setNativeImagesSupported(true); AFPRenderingContext context = new AFPRenderingContext(null, null, state, null, null); - MimeEnabledImageFlavor flavor = new MimeEnabledImageFlavor(ImageFlavor.RAW, MimeConstants.MIME_PDF); - ImageRawStream stream = new ImageRawStream(null, flavor, (InputStream) null); + ImageRawStream stream = new ImageRawStream(null, ImageFlavor.RAW_PDF, (InputStream) null); Assert.assertTrue(new AFPImageHandlerRawStream().isCompatible(context, stream)); + Assert.assertFalse(Arrays.asList( + new AFPImageHandlerRawStream().getSupportedImageFlavors()).contains(ImageFlavor.RAW)); } } diff --git a/fop/lib/xmlgraphics-commons-svn-trunk.jar b/fop/lib/xmlgraphics-commons-svn-trunk.jar index 3cdc9a723..542966f5f 100644 Binary files a/fop/lib/xmlgraphics-commons-svn-trunk.jar and b/fop/lib/xmlgraphics-commons-svn-trunk.jar differ -- cgit v1.2.3