title: Apache POI Excel sheet: resize a picture while keeping its ratio
body: <p>Hello I have created excel sheet by using POI. I've added picture(jpg-file) in the next way:</p>
  
  <pre><code>Workbook wb = new HSSFWorkbook();
  CreationHelper helper = wb.getCreationHelper();
  //...
  InputStream is = new FileInputStream("img.jpg");
  byte[] bytes = IOUtils.toByteArray(is);
  int picIdx = wb.addPicture(bytes, Workbook.PICTURE_TYPE_JPEG);
  Drawing drawing = sheet.createDrawingPatriarch();
  ClientAnchor anchor = helper.createClientAnchor();
  anchor.setCol1(5);
  anchor.setRow1(5);
  Picture pict = drawing.createPicture(anchor, picIdx);
  pict.resize();
  </code></pre>
  
  <p>Now I want the picture to fit into that cell, but i don't want to change its aspect ratio. the scales i can put into resize are in respect to the cell, which obviously can have a different ratio. I tried to calculate the scales but the problem is, that I can't get or set the row height in pixel, only in pt and i can't compute the cells ratio either bc the i can't get width and height in the same unit... Any suggestions?</p>