code: public CmsJspImageBean createRatioVariation(String ratioStr) {
  
          CmsJspImageBean result = null;
  
          try {
              int i = ratioStr.indexOf('-');
              if (i > 0) {
                  ratioStr = ratioStr.replace(',', '.');
  
                  double ratioW = Double.valueOf(ratioStr.substring(0, i)).doubleValue();
                  double ratioH = Double.valueOf(ratioStr.substring(i + 1)).doubleValue();
  
                  int targetWidth, targetHeight;
  
                  double ratioFactorW = getScaler().getWidth() / ratioW;
                  targetWidth = getScaler().getWidth();
                  targetHeight = (int)Math.round(ratioH * ratioFactorW);
  
                  if (targetHeight > getScaler().getHeight()) {
                      double ratioFactorH = getScaler().getHeight() / ratioH;
                      targetWidth = (int)Math.round(ratioW * ratioFactorH);
                      targetHeight = getScaler().getHeight();
                  }
  
                  CmsImageScaler targetScaler = createVariation(
                      getWidth(),
                      getHeight(),
                      getBaseScaler(),
                      targetWidth,
                      targetHeight,
                      getQuality());
  
                  if (targetScaler != null) {
                      result = createVariation(targetScaler);
                      result.m_ratio = ratioStr;
                      result.m_ratioHeightPercentage = calcRatioHeightPercentage(ratioW, ratioH);
                  }
              }
          } catch (NumberFormatException e) {
              if (LOG.isWarnEnabled()) {
                  LOG.warn(String.format("Illegal ratio format: '%s' not usable for image scaling", ratioStr));
              }
          }
  
          return result;
      }
docs: Creates a ratio scaled version of the current image.<p>
  
  @param ratioStr the rato variation to generate, for example "4-3" or "1-1".<p>
  
  @return a ratio scaled version of the current image