Skip to content
This repository was archived by the owner on Feb 11, 2019. It is now read-only.
This repository was archived by the owner on Feb 11, 2019. It is now read-only.

Bug when using AVLayerVideoGravityResizeAspectFill #2

@warpling

Description

@warpling

The method videoPreviewBoxForGravity:frameSize:apertureSize: should return a video box with a negative x/y origin when the videoBox width/height is greater than the frame width/height!

Here's the fix!
(Lines 175-185 in DetectFace.m)

    CGRect videoBox;
    videoBox.size = size;
    if (size.width < frameSize.width)
        videoBox.origin.x = (frameSize.width - size.width) / 2;
    else
        videoBox.origin.x = -(size.width - frameSize.width) / 2;

    if ( size.height < frameSize.height )
        videoBox.origin.y = (frameSize.height - size.height) / 2;
    else
        videoBox.origin.y = -(size.height - frameSize.height) / 2;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions