CropOptions: {
    gravity?: {
        offset?: {
            x: number;
            y: number;
        };
        type: GravityType;
    };
    height?: number;
    width?: number;
}

The available options for the crop operation

Type declaration

  • Optional gravity?: {
        offset?: {
            x: number;
            y: number;
        };
        type: GravityType;
    }

    (Optional) The gravity for the cropping operation

    • Optional offset?: {
          x: number;
          y: number;
      }

      (Optional) Specifies the offset by X and Y axes

      • x: number

        The gravity offset on the X axis

      • y: number

        The gravity offset on the Y axis

    • type: GravityType

      Specifies the gravity type

  • Optional height?: number

    The height of the cropped size

    if height == 0 or unset : imgproxy uses the full height
    if height >= 1 : imgproxy treats it as absolute value
    if height <= 1 : imgproxy treats it as relative value
  • Optional width?: number

    The width of the cropped size

    if width == 0 or unset : imgproxy uses the full width
    if width >= 1 : imgproxy treats it as absolute value
    if width <= 1 : imgproxy treats it as relative value

Generated using TypeDoc