int contentWidth = imageBounds.width;
if (this.calculateByWidth && (contentWidth > bounds.width)) {
int contentToCellDiff = (cell.getBounds().width - bounds.width);
ILayer layer = cell.getLayer();
layer.doCommand(new ColumnResizeCommand(
layer,
cell.getColumnPosition(),
contentWidth + contentToCellDiff));
}