0

Half the times the captured photo comes up totally dark when using flash - the ios camera app doesn't misfire like this.

the gpuimage code for above is at https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageStillCamera.m

-(void)capturePhotoProcessedUpToFilter:(GPUImageOutput<GPUImageInput> *)finalFilterInChain withImageOnGPUHandler:(void (^)(NSError *error))block 
guptha
  • 529
  • 1
  • 4
  • 9
  • Can you show how you set up your camera, and where you enable the flash? When you enable the flash matters, as this setting can be overwritten if you set it at the wrong time. – Brad Larson Jan 16 '14 at 21:59
  • The camera setup is similar to the examples provided. The flash is turned on or off based on UI setting, which can be done any time by the user. When the user has turned it on, the app sets it using code like below. Then, the photo is captured when she/he clicks a button - all standard. AVCaptureDevice *device = self.videoCamera.inputCamera; NSError *error = nil; if ([device lockForConfiguration:&error]) { { if ([device isFlashModeSupported:AVCaptureFlashModeOn]) { [device setFlashMode:AVCaptureFlashModeOn]; } } [device unlockForConfiguration]; – user3127923 Jan 17 '14 at 02:22
  • Take a look at the following issues: https://github.com/BradLarson/GPUImage/issues/84 and https://github.com/BradLarson/GPUImage/issues/893 . The former shows the code and sequence I used for enabling flash in the SimplePhotoFilter example, and it worked every time when I tried. The latter indicates a possible glitch on certain OS versions, but I can't confirm that or reproduce it myself. – Brad Larson Jan 17 '14 at 15:57
  • hi brad, thx for getting back - but our code shown above is identical - from Apple docs - all standard. i've searched thru' the issues on github even before posting, but they are not what we are experiencing. in our case, the flash fires everytime and image is also captured everytime, but the timing of flash firing is off more than 50% of the time - so over half the phtos turn out very dark and bad... – user3127923 Jan 17 '14 at 23:01

0 Answers0