* @return the new Dimensions of the scaled picture in EMUs
*/
public static Dimension setPreferredSize(Picture picture, double scaleX, double scaleY){
ClientAnchor anchor = picture.getClientAnchor();
boolean isHSSF = (anchor instanceof HSSFClientAnchor);
PictureData data = picture.getPictureData();
Sheet sheet = picture.getSheet();
// in pixel
Dimension imgSize = getImageDimension(new ByteArrayInputStream(data.getData()), data.getPictureType());
// in emus
Dimension anchorSize = ImageUtils.getDimensionFromAnchor(picture);
final double scaledWidth = (scaleX == Double.MAX_VALUE)
? imgSize.getWidth() : anchorSize.getWidth()/EMU_PER_PIXEL * scaleX;
final double scaledHeight = (scaleY == Double.MAX_VALUE)