BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.85k stars 605 forks source link

I encountered a crash problem #339

Open zjn-116373914 opened 2 months ago

zjn-116373914 commented 2 months ago

I encountered a crash problem. Crash's location is "cgImageFromFramebuffer" method in "PictureOutput.swift" class Crash's point is "return CGImage(width:Int(framebuffer.size.width), height:Int(framebuffer.size.height), bitsPerComponent:8, bitsPerPixel:32, bytesPerRow:4 Int(framebuffer.size.width), space:defaultRGBColorSpace, bitmapInfo:CGBitmapInfo() /| CGImageAlphaInfo.Last*/, provider:dataProvider, decode:nil, shouldInterpolate:false, intent:.defaultIntent)!" line Crash's reason is "verify_image_parameters: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast" Tap : Would you mind fixing this crash as soon as possible ?

Operating environment Device : iPhone11 OS : iOS 17.1.2 Version : 0.0.1

hudek commented 1 month ago

This should work: Just change bitmapInfo:CGBitmapInfo(rawValue: CGImageAlphaInfo.noneSkipLast.rawValue)

return CGImage(width:Int(framebuffer.size.width), height:Int(framebuffer.size.height), bitsPerComponent:8, bitsPerPixel:32, bytesPerRow:4 Int(framebuffer.size.width), space:defaultRGBColorSpace, bitmapInfo:CGBitmapInfo(rawValue: CGImageAlphaInfo.noneSkipLast.rawValue) /| CGImageAlphaInfo.Last*/, provider:dataProvider, decode:nil, shouldInterpolate:false, intent:.defaultIntent)!