.. index:: 
  !PortraitProcessor.cropAspectRatio Property

.. _id3_face_portrait_processor_crop_aspect_ratio_class_member:

===============================================================================
PortraitProcessor.cropAspectRatio Property
===============================================================================

Module: :ref:`PortraitProcessor<id3_face_portrait_processor_class>`

Type: float

Definition
----------

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

.. hint:: Default value is 4/3.


.. tab-set::

  .. tab-item:: Python
    :sync: Python

    .. code:: Python

      crop_aspect_ratio: float


    **Exceptions**

      .. line-block::

        :ref:`FaceException<id3_face_face_exception>`
        An error has occurred during Face Library execution.

  .. tab-item:: Dart
    :sync: Dart

    .. code:: Dart

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


    **Exceptions**

      .. line-block::

        :ref:`FaceException<id3_face_face_exception>`
        An error has occurred during Face Library execution.

  .. tab-item:: C#
    :sync: C#

    .. code:: C#

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


    **Exceptions**

      .. line-block::

        :ref:`FaceException<id3_face_face_exception>`
        An error has occurred during Face Library execution.

  .. tab-item:: Java
    :sync: Java

    .. code:: Java

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


    **Exceptions**

      .. line-block::

        :ref:`FaceException<id3_face_face_exception>`
        An error has occurred during Face Library execution.

  .. tab-item:: Swift
    :sync: Swift

    .. code:: Swift

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


    **Exceptions**

      .. line-block::

        :ref:`FaceException<id3_face_face_exception>`
        An error has occurred during Face Library execution.

  .. tab-item:: C
    :sync: C

    .. code:: C

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

    **Returns**
   
      .. line-block::

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

