src/main/java/de/digitalcollections/iiif/model/image/SizeRequest.java
public String getCanonicalForm(Dimension nativeSize, ImageApiProfile profile) throws ResolvingException {
    Dimension resolved = this.resolve(nativeSize, profile);
    // "w," requests are already canonical
    double nativeRatio = nativeSize.getWidth() / nativeSize.getHeight();
    double resolvedRatio = resolved.getWidth() / resolved.getHeight();
    if (resolved.equals(nativeSize)) {
      return "full";
    } else if (this.width != null && this.height == null) {
      return this.toString();
    } else if (Math.floor(resolvedRatio * nativeSize.getHeight()) == nativeSize.getWidth()
               || Math.ceil(resolvedRatio * nativeSize.getHeight()) == nativeSize.getWidth()) {
      return String.format("%d,", resolved.width);
    } else {
      return String.format("%d,%d", resolved.width, resolved.height);
    }
  }
public String getCanonicalForm(Dimension nativeSize, ImageApiProfile profile) throws ResolvingException {
    Dimension resolved = this.resolve(nativeSize, profile);
    // "w," requests are already canonical
    double nativeRatio = nativeSize.getWidth() / nativeSize.getHeight();
    double resolvedRatio = resolved.getWidth() / resolved.getHeight();
    if (resolved.equals(nativeSize)) {
      return "full";
    } else if (this.width != null && this.height == null) {
      return this.toString();
    } else if (Math.floor(resolvedRatio * nativeSize.getHeight()) == nativeSize.getWidth()
               || Math.ceil(resolvedRatio * nativeSize.getHeight()) == nativeSize.getWidth()) {
      return String.format("%d,", resolved.width);
    } else {
      return String.format("%d,%d", resolved.width, resolved.height);
    }
  }
public String getCanonicalForm ( Dimension nativeSize , ImageApiProfile profile ) throws ResolvingException { Dimension resolved = this . resolve ( nativeSize , profile ) ; // "w," requests are already canonical double nativeRatio = nativeSize . getWidth ( ) / nativeSize . getHeight ( ) ; double resolvedRatio = resolved . getWidth ( ) / resolved . getHeight ( ) ; if ( resolved . equals ( nativeSize ) ) { return "full" ; } else if ( this . width != null && this . height == null ) { return this . toString ( ) ; } else if ( Math . floor ( resolvedRatio * nativeSize . getHeight ( ) ) == nativeSize . getWidth ( ) || Math . ceil ( resolvedRatio * nativeSize . getHeight ( ) ) == nativeSize . getWidth ( ) ) { return String . format ( "%d," , resolved . width ) ; } else { return String . format ( "%d,%d" , resolved . width , resolved . height ) ; } }
Get the canonical form of this request.
@see <a href="http://iiif.io/api/image/2.1/#canonical-uri-syntax">IIIF Image API specification</a>

@param nativeSize native size of request
@param profile image api profile
@return canonical form of this request
@throws de.digitalcollections.iiif.model.image.ResolvingException if nativeSize can not be converted to canonical form
Get the canonical form of this request . @see <a href = http : // iiif . io / api / image / 2 . 1 / #canonical - uri - syntax > IIIF Image API specification< / a >