// work out maximum zoom ratio available so that thumbnail isn't too big
double xZoom = inMaxWidth * 1.0 / inOrigWidth;
double yZoom = inMaxHeight * 1.0 / inOrigHeight;
double zoom = (xZoom > yZoom?yZoom:xZoom);
// Don't make thumbnail bigger than picture
if (zoom > 1.0) {return new Dimension(inOrigWidth, inOrigHeight);}
// work out maximum zoom ratio available so that thumbnail isn't too big
double xZoom = inMaxWidth * 1.0 / inOrigWidth;
double yZoom = inMaxHeight * 1.0 / inOrigHeight;
double zoom = (xZoom > yZoom?yZoom:xZoom);
// Don't make thumbnail bigger than picture
if (zoom > 1.0) {return new Dimension(inOrigWidth, inOrigHeight);}