*/
protected GraphicsNode createImageGraphicsNode
(BridgeContext ctx, Element imageElement, ParsedURL purl) {
AbstractFOPBridgeContext bridgeCtx = (AbstractFOPBridgeContext)ctx;
ImageManager manager = bridgeCtx.getImageManager();
ImageSessionContext sessionContext = bridgeCtx.getImageSessionContext();
try {
ImageInfo info = manager.getImageInfo(purl.toString(), sessionContext);
ImageFlavor[] supportedFlavors = getSupportedFlavours();
Image image = manager.getImage(info, supportedFlavors, sessionContext);
//TODO color profile overrides aren't handled, yet!
//ICCColorSpaceExt colorspaceOverride = extractColorSpace(e, ctx);
AbstractGraphicsNode specializedNode = null;
if (image instanceof ImageXMLDOM) {
ImageXMLDOM xmlImage = (ImageXMLDOM)image;
if (xmlImage.getDocument() instanceof SVGDocument) {
return createSVGImageNode(ctx, imageElement,
(SVGDocument)xmlImage.getDocument());
} else {
//Convert image to Graphics2D
image = manager.convertImage(xmlImage,
new ImageFlavor[] {ImageFlavor.GRAPHICS2D});
}
}
if (image instanceof ImageRawJPEG) {
specializedNode = createLoaderImageNode(image, ctx, imageElement, purl);