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.88k stars 611 forks source link

iOS 10.3.3 iphone 5, 5c crash inside FramebufferCache.swift #247

Open NosovPavel opened 6 years ago

NosovPavel commented 6 years ago

Hi!

I'm using GPUImage to extract AverageColor from image and in some cases I got an error in FramebufferCache at line 39. This is only happened on iPhone 5, 5c with iOS 10.3.3.

What i do:

func calcTintColor(for image: UIImage, sync: Bool = true) {

 let averageColor = AverageColorExtractor()
    averageColor.extractedColorCallback = ({ color in

        let uicolor = UIColor(red: CGFloat(color.redComponent), green: CGFloat(color.greenComponent), blue: CGFloat(color.blueComponent), alpha: CGFloat(color.alphaComponent))
        print(uicolor)

    })

    let pictureInput = PictureInput(image: image)
    let pictureOutput = PictureOutput()

    pictureInput --> averageColor --> pictureOutput
    pictureInput.processImage(synchronously: sync)
}

I have checked on a couple of images and on some of them bug exists.

This is link on image with which you can reproduce behaviour.

Also this is the whole project

How to fix it?