code: private RenditionMetadata getVirtualRendition(final Set<RenditionMetadata> candidates, MediaArgs mediaArgs) {
  
      // get from fixed with/height
      if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
        long destWidth = mediaArgs.getFixedWidth();
        long destHeight = mediaArgs.getFixedHeight();
        double destRatio = 0;
        if (destWidth > 0 && destHeight > 0) {
          destRatio = (double)destWidth / (double)destHeight;
        }
        return getVirtualRendition(candidates, destWidth, destHeight, destRatio);
      }
  
      // or from any media format
      return visitMediaFormats(mediaArgs, new MediaFormatVisitor<RenditionMetadata>() {
        @Override
        public RenditionMetadata visit(MediaFormat mediaFormat) {
          int destWidth = (int)mediaFormat.getEffectiveMinWidth();
          int destHeight = (int)mediaFormat.getEffectiveMinHeight();
          double destRatio = mediaFormat.getRatio();
          // try to find matching rendition, otherwise check for next media format
          RenditionMetadata rendition = getVirtualRendition(candidates, destWidth, destHeight, destRatio);
          if (rendition != null) {
            rendition.setMediaFormat(mediaFormat);
          }
          return rendition;
        }
      });
    }
docs: Check if a rendition is available from which the required format can be downscaled from and returns
  a virtual rendition in this case.
  @param candidates Candidates
  @param mediaArgs Media args
  @return Rendition or null