if (format == -1)
{
// This is a unsupported image format.
if (reference instanceof LocalImageContainer)
{
final LocalImageContainer li = (LocalImageContainer) reference;
image = li.getImage();
}
if (image == null)
{
try
{
final Resource resource = resourceManager.create(url, null, Image.class);
image = (Image) resource.getResource();
}
catch (ResourceException re)
{
ExcelPrinter.logger.info("Failed to load image from URL " + url, re);
}
}
}
else
{
try
{
final ResourceData data = resourceManager.load(url);
// create the image
return workbook.addPicture(data.getResource(resourceManager), format);
}
catch (ResourceException re)
{
ExcelPrinter.logger.info("Failed to load image from URL " + url, re);
}
}
}
}
if (reference instanceof LocalImageContainer)
{
// Check, whether the imagereference contains an AWT image.
// if so, then we can use that image instance for the recoding
final LocalImageContainer li = (LocalImageContainer) reference;
if (image == null)
{
image = li.getImage();
}
}
if (image != null)
{