docs: public CmsImageScaler getDownScaler(CmsImageScaler downScaler) {
  
          if (!isDownScaleRequired(downScaler)) {
              // no down scaling is required
              return null;
          }
  
          int downHeight = downScaler.getHeight();
          int downWidth = downScaler.getWidth();
  
          int height = getHeight();
          int width = getWidth();
  
          if (((height > width) && (downHeight < downWidth)) || ((width > height) && (downWidth < downHeight))) {
              // adjust orientation
              downHeight = downWidth;
              downWidth = downScaler.getHeight();
          }
  
          if (width > downWidth) {
              // width is too large, re-calculate height
              float scale = (float)downWidth / (float)width;
              downHeight = Math.round(height * scale);
          } else if (height > downHeight) {
              // height is too large, re-calculate width
              float scale = (float)downHeight / (float)height;
              downWidth = Math.round(width * scale);
          } else {
              // something is wrong, don't down scale
              return null;
          }
  
          // now create and initialize the result scaler
          return new CmsImageScaler(downScaler, downWidth, downHeight);
      }