We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to use GPUImage3 inside a ASNetworkImageNode's imageModificationBlock:
node.imageModificationBlock = { image, _ in let luminance = Luminance() let exposure = ExposureAdjustment() exposure.exposure = -0.3 return image.filterWithPipeline { input, output in input --> luminance --> exposure --> output } }
It crashes sometimes with the following error:
Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/mc/Test/GPUImage3/framework/Source/PictureInput.swift, line 20
#if canImport(UIKit) public convenience init(image:UIImage, smoothlyScaleOutput:Bool = false, orientation:ImageOrientation = .portrait) { self.init(image: image.cgImage!, smoothlyScaleOutput: smoothlyScaleOutput, orientation: orientation) }
The text was updated successfully, but these errors were encountered:
Is the filterWithPipeline holding a weak reference to image?
Sorry, something went wrong.
The solution is to make sure image.cgImage isn't nil :
node.imageModificationBlock = { image, _ in guard image.cgImage != nil else { return image } let luminance = Luminance() let exposure = ExposureAdjustment() exposure.exposure = -0.3 return image.filterWithPipeline { input, output in input --> luminance --> exposure --> output } }
No branches or pull requests
Trying to use GPUImage3 inside a ASNetworkImageNode's imageModificationBlock:
It crashes sometimes with the following error:
The text was updated successfully, but these errors were encountered: