Function cropImage

  • Internal

    Crops and area from an image buffer and returns the resulting buffer

    Parameters

    • buf: Buffer

      The image buffer to use.

    • x1: number

      Top left x coordinate.

    • y1: number

      Top left y coordinate.

    • x2: number

      Bottom right x coordinate.

    • y2: number

      Bottom right y coordinate.

    Returns Promise<Buffer>