private Image getImage(CellAttributes attributes)
{
var path = FuncHelper.ApplyFormula(attributes.BasicProperties.DisplayFormatFormula, attributes.RowData.Value);
attributes.RowData.FormattedValue = path;
if (!string.IsNullOrEmpty(path) && File.Exists(path))
{
return path.GetITextSharpImageFromImageFile(_cacheImages);
}
if (!string.IsNullOrEmpty(_defaultImageFilePath) && File.Exists(_defaultImageFilePath))
{
return _defaultImageFilePath.GetITextSharpImageFromImageFile(this._cacheImages);
}
throw new FileNotFoundException(string.Format(CultureInfo.InvariantCulture, "{0} does not exists & defaultImageFilePath was not found.", path));
}