Created attachment 26918 [details] Modified java file with bug fixed Overview The calculation of image width and height in the class XSSFPicture of the package org.apache.poi.xssf.usermodel has a bug: If an image fits into one cell (in the second or one of the following columns), the width calculation leads to wrong results, because cw is taken from the next column, which is not relevant in that case: double cw = getColumnWidthInPixels(col2 + 1); A quick and dirty solution would be to check, if the last column (col2) is the same as the first and calculate the dx2 accordingly: if (col2 == anchor.getCol1()) { = (int) (EMU_PER_PIXEL * scaledWidth); } Same for image height. Steps to Reproduce Just ad an image to a an XLSX which fits into one cell (using the XSSF model). Build Date & Platform poi-3.7-20101029 on Windows Attachment The java file with the corrections is attached. (However, there might be a better way to solve this.)
Fixed in r1128422 Yegor