]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-3032: Embed pdf into afp using unique type
authorSimon Steiner <ssteiner@apache.org>
Fri, 5 Nov 2021 13:46:18 +0000 (13:46 +0000)
committerSimon Steiner <ssteiner@apache.org>
Fri, 5 Nov 2021 13:46:18 +0000 (13:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1894760 13f79535-47bb-0310-9956-ffa450edef68

fop-core/src/main/java/org/apache/fop/render/afp/AFPImageHandlerRawStream.java
fop-core/src/test/java/org/apache/fop/render/afp/AFPImageHandlerRawStreamTestCase.java
fop/lib/xmlgraphics-commons-svn-trunk.jar

index 36e5a9db2abffc588de8422d7dbfb7c11be93ee3..cc072e31889b3e3adba07e22599cfbee9909add0 100644 (file)
@@ -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 */
index 9a9ea8558c7b715a9b7b1d5dc72adbc57c4ab76a..36460ae0d3569e0f202735e74ccc422caa4d23bc 100644 (file)
 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));
     }
 }
index 3cdc9a7235f0863ff9afc066d5436ff355fd9cb6..542966f5f3f044bffb501ad34ce6b7a39affb5a6 100644 (file)
Binary files a/fop/lib/xmlgraphics-commons-svn-trunk.jar and b/fop/lib/xmlgraphics-commons-svn-trunk.jar differ