*/
protected void drawImage(Image image, Rectangle rect,
RenderingContext context, boolean convert, Map additionalHints)
throws IOException, ImageException {
ImageManager manager = getFopFactory().getImageManager();
ImageHandlerRegistry imageHandlerRegistry = getFopFactory().getImageHandlerRegistry();
Image effImage;
context.putHints(additionalHints);
if (convert) {
Map hints = createDefaultImageProcessingHints(getUserAgent().getImageSessionContext());
if (additionalHints != null) {
hints.putAll(additionalHints);
}
effImage = manager.convertImage(image,
imageHandlerRegistry.getSupportedFlavors(context), hints);
} else {
effImage = image;
}
//First check for a dynamically registered handler
ImageHandler handler = imageHandlerRegistry.getHandler(context, effImage);
if (handler == null) {
throw new UnsupportedOperationException(
"No ImageHandler available for image: "
+ effImage.getInfo() + " (" + effImage.getClass().getName() + ")");
}