Skip to content

Commit a9ed4bd

Browse files
FOP-3241: Add option to convert image to CMYK
1 parent 77cab48 commit a9ed4bd

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.commons.logging.Log;
3535
import org.apache.commons.logging.LogFactory;
3636

37+
import org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO;
3738
import org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry;
3839
import org.apache.xmlgraphics.image.loader.util.Penalty;
3940
import org.apache.xmlgraphics.io.ResourceResolver;
@@ -455,6 +456,7 @@ private void configureImageLoading(Configuration parent, boolean strict) throws
455456
} catch (ConfigurationException e) {
456457
LogUtil.handleException(LOG, e, strict);
457458
}
459+
registry.setICCConverter(parent.getAttribute(ImageLoaderImageIO.ICC_CONVERTER, null));
458460
}
459461

460462
/**

fop-core/src/main/java/org/apache/fop/render/intermediate/AbstractIFPainter.java

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.xmlgraphics.image.loader.ImageInfo;
4242
import org.apache.xmlgraphics.image.loader.ImageManager;
4343
import org.apache.xmlgraphics.image.loader.ImageSessionContext;
44+
import org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO;
4445
import org.apache.xmlgraphics.image.loader.util.ImageUtil;
4546

4647
import org.apache.fop.ResourceEventProducer;
@@ -160,6 +161,7 @@ protected void drawImageUsingImageHandler(ImageInfo info, Rectangle rect)
160161

161162
ImageFlavor[] flavors = imageHandlerRegistry.getSupportedFlavors(context, getImageForSupportedFlavors(info));
162163
info.getCustomObjects().put("warningincustomobject", true);
164+
info.getCustomObjects().put(ImageLoaderImageIO.ICC_CONVERTER, manager.getRegistry().getIccConverter());
163165
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
164166
info, flavors,
165167
hints, sessionContext);

0 commit comments

Comments
 (0)