code: public CmsImageScaler getWidthScaler(CmsImageScaler downScaler) {
  
          int width = downScaler.getWidth();
          int height;
  
          if (getWidth() > width) {
              // width is too large, re-calculate height
              float scale = (float)width / (float)getWidth();
              height = Math.round(getHeight() * scale);
          } else {
              // width is ok
              width = getWidth();
              height = getHeight();
          }
  
          // now create and initialize the result scaler
          return new CmsImageScaler(downScaler, width, height);
      }
docs: Returns a new image scaler that is a width based down scale from the size of <code>this</code> scaler
  to the given scaler size.<p>
  
  If no down scale from this to the given scaler is required because the width of <code>this</code>
  scaler is not larger than the target width, then the image dimensions of <code>this</code> scaler
  are unchanged in the result scaler. No up scaling is done!<p>
  
  @param downScaler the image scaler that holds the down scaled target image dimensions
  
  @return a new image scaler that is a down scale from the size of <code>this</code> scaler
  to the given target scaler size