code: public boolean isDownScaleRequired(CmsImageScaler downScaler) {
  
          if ((downScaler == null) || !isValid() || !downScaler.isValid()) {
              // one of the scalers is invalid
              return false;
          }
  
          if (getPixelCount() < (downScaler.getPixelCount() / 2)) {
              // the image has much less pixels then the target, so don't downscale
              return false;
          }
  
          int downWidth = downScaler.getWidth();
          int downHeight = downScaler.getHeight();
          if (downHeight > downWidth) {
              // normalize image orientation - the width should always be the large side
              downWidth = downHeight;
              downHeight = downScaler.getWidth();
          }
          int height = getHeight();
          int width = getWidth();
          if (height > width) {
              // normalize image orientation - the width should always be the large side
              width = height;
              height = getWidth();
          }
  
          return (width > downWidth) || (height > downHeight);
      }
docs: Returns <code>true</code> if this image scaler must be down scaled when compared to the
  given "down scale" image scaler.<p>
  
  If either <code>this</code> scaler or the given <code>downScaler</code> is invalid according to
  {@link #isValid()}, then <code>false</code> is returned.<p>
  
  The use case: <code>this</code> scaler represents an image (that is contains width and height of
  an image). The <code>downScaler</code> represents the maximum wanted image. The scalers
  are compared and if the image represented by <code>this</code> scaler is too large,
  <code>true</code> is returned. Image orientation is ignored, so for example an image with 600x800 pixel
  will NOT be down scaled if the target size is 800x600 but kept unchanged.<p>
  
  @param downScaler the down scaler to compare this image scaler with
  
  @return <code>true</code> if this image scaler must be down scaled when compared to the
  given "down scale" image scaler