Permalink
Browse files

flash fixes, via @kaspik

  • Loading branch information...
piemonte committed Apr 19, 2017
1 parent e730e35 commit e2b653546861806f034689df8ed1f2243f3d94fa
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/PBJVision.m
View
@@ -526,7 +526,7 @@ - (void) _setCurrentDevice:(AVCaptureDevice *)device
- (BOOL)isFlashAvailable
{
return (_currentDevice && [_currentDevice hasFlash]);
return (_currentDevice && [_currentDevice hasFlash] && [_currentDevice isFlashAvailable]);
}
- (void)setFlashMode:(PBJFlashMode)flashMode {
@@ -1736,7 +1736,7 @@ - (void)capturePhoto
if ([AVCapturePhotoOutput class]) {
AVCapturePhotoSettings *settings = [AVCapturePhotoSettings photoSettingsWithFormat:@{AVVideoCodecKey : AVVideoCodecJPEG}];
settings.highResolutionPhotoEnabled = YES;
settings.flashMode = (AVCaptureFlashMode)self.flashMode;
settings.flashMode = [self isFlashAvailable] ? (AVCaptureFlashMode)self.flashMode : AVCaptureFlashModeOff;
[_captureOutputPhoto capturePhotoWithSettings:settings delegate:self];
}

0 comments on commit e2b6535

Please sign in to comment.