[ad_1]
I am using GPUImage with Swift 3.0. And I am trying to filter an image but GPUImage crashes saying image size should be more than 0.
My code-
let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)
let ciImage = CIImage(cvPixelBuffer: pixelBuffer!)
var image = UIImage(ciImage: ciImage)
if image.size.height > 0 && image.size.width > 0
let contrastfilter = GPUImageContrastFilter()
image = contrastfilter.image(byFilteringImage: image)
Error-
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Passed image must not be empty - it should be at least 1px tall and wide'
Question is-
I have already checked if the height is greater than zero and then only called the function but still, it gives an error.
[ad_2]
لینک منبع