GPUImage3 icon indicating copy to clipboard operation
GPUImage3 copied to clipboard

The front camera is upside down.

Open gpapoyan95 opened this issue 7 years ago • 5 comments

When I'm trying to swap camera to the front, the preview is rotated upside down. Any solution?

gpapoyan95 avatar Dec 20 '18 21:12 gpapoyan95

@gpapoyan95 Can you please attach a small project to repro this?

JohannMG avatar Dec 21 '18 02:12 JohannMG

When I'm trying to swap camera to the front, the preview is rotated upside down. Any solution?

In my opinion , you can try to transform your renderView to solve this problem

Peterfelee avatar Apr 04 '19 05:04 Peterfelee

I changed .portrait to .landscapeRight in imageOrientation for front camera and its working fine. @BradLarson please review it if its correct.

func imageOrientation() -> ImageOrientation {
    switch self {
    case .backFacing: return .landscapeRight
    case .frontFacing: return .landscapeRight  // this was  .portrait
    }
}

jagdev7dayz avatar Jun 03 '19 10:06 jagdev7dayz

I add code in Camera.swift if self.location == .frontFacing{ connection.videoOrientation = .landscapeRight } @jagdev7dayz I don't know which solution is better

wangdenkun avatar Jun 06 '19 01:06 wangdenkun

a soulution i have found to preserve the mirroring aspect (and fixing the upside-down bug) of the front camera is to set in ImageOrientation.swift L15:

case (.landscapeLeft, .portrait): return .rotateClockwiseAndFlipVertically // previously: return .rotateClockwise

luoser avatar Aug 21 '20 22:08 luoser