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

Bug when using AVLayerVideoGravityResizeAspectFill #2

Open
warpling opened this issue Sep 5, 2015 · 0 comments
Open

Bug when using AVLayerVideoGravityResizeAspectFill #2

warpling opened this issue Sep 5, 2015 · 0 comments

Comments

@warpling
Copy link

warpling commented Sep 5, 2015

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;
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant