src/main/java/de/digitalcollections/iiif/model/image/ImageApiSelector.java
public String getCanonicalForm(Dimension nativeSize, ImageApiProfile profile, Quality defaultQuality) throws ResolvingException {
    Dimension scaleReference = nativeSize;
    Rectangle2D canonicalRegion = RegionRequest.fromString(region.getCanonicalForm(nativeSize)).getRegion();
    if (canonicalRegion != null) {
      scaleReference = new Dimension((int) canonicalRegion.getWidth(), (int) canonicalRegion.getHeight());
    }
    return String.format(
        "%s%s/%s/%s/%s.%s",
        identifier != null ? urlEncode(identifier) + "/" : "",
        region.getCanonicalForm(nativeSize),
        size.getCanonicalForm(scaleReference, profile),
        rotation.toString(),
        quality.equals(defaultQuality) ? "default" : quality.toString(),
        format.toString());
  }
public String getCanonicalForm(Dimension nativeSize, ImageApiProfile profile, Quality defaultQuality) throws ResolvingException {
    Dimension scaleReference = nativeSize;
    Rectangle2D canonicalRegion = RegionRequest.fromString(region.getCanonicalForm(nativeSize)).getRegion();
    if (canonicalRegion != null) {
      scaleReference = new Dimension((int) canonicalRegion.getWidth(), (int) canonicalRegion.getHeight());
    }
    return String.format(
        "%s%s/%s/%s/%s.%s",
        identifier != null ? urlEncode(identifier) + "/" : "",
        region.getCanonicalForm(nativeSize),
        size.getCanonicalForm(scaleReference, profile),
        rotation.toString(),
        quality.equals(defaultQuality) ? "default" : quality.toString(),
        format.toString());
  }
public String getCanonicalForm ( Dimension nativeSize , ImageApiProfile profile , Quality defaultQuality ) throws ResolvingException { Dimension scaleReference = nativeSize ; Rectangle2D canonicalRegion = RegionRequest . fromString ( region . getCanonicalForm ( nativeSize ) ) . getRegion ( ) ; if ( canonicalRegion != null ) { scaleReference = new Dimension ( ( int ) canonicalRegion . getWidth ( ) , ( int ) canonicalRegion . getHeight ( ) ) ; } return String . format ( "%s%s/%s/%s/%s.%s" , identifier != null ? urlEncode ( identifier ) + "/" : "" , region . getCanonicalForm ( nativeSize ) , size . getCanonicalForm ( scaleReference , profile ) , rotation . toString ( ) , quality . equals ( defaultQuality ) ? "default" : quality . toString ( ) , format . toString ( ) ) ; }
Create the canonical of the Image API request.See http://iiif.io/api/image/2.1/#canonical-uri-syntax

@param nativeSize      Native size of the image the selector is applied to
@param profile         Image API profile used
@param defaultQuality  The native/default quality of the image the selector is applied to
@return The canonical form of the Image API request
@throws de.digitalcollections.iiif.model.image.ResolvingException if RegionRequest can not be instantiated from canonical form of region
Create the canonical of the Image API request . See http : // iiif . io / api / image / 2 . 1 / #canonical - uri - syntax