Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# PortraitProcessor.cropAspectRatio Property

Module: PortraitProcessor

Type: float

## Definition

Aspect ratio (height to width) of the cropped portrait image.

Hint

Default value is 4/3.

Python

    crop_aspect_ratio: float

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    double get cropAspectRatio => getCropAspectRatio();
    set cropAspectRatio(double value) => setCropAspectRatio(value);

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public float cropAspectRatio
    {
        get => GetcropAspectRatio();
        set => SetcropAspectRatio(ref value);
    }

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public float getCropAspectRatio() throws FaceException
    public void setCropAspectRatio(float cropAspectRatio) throws FaceException

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public var cropAspectRatio: Float
        get {
            return try! getCropAspectRatio()
        }
    }

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3FacePortraitProcessor_GetCropAspectRatio (ID3_FACE_PORTRAIT_PROCESSOR hPortraitProcessor, float * cropAspectRatio)
    int id3FacePortraitProcessor_SetCropAspectRatio (ID3_FACE_PORTRAIT_PROCESSOR hPortraitProcessor, float cropAspectRatio)

Returns

> `int`
> An error code.
> See id3FaceError file for the list of possible error codes.