ColorKit icon indicating copy to clipboard operation
ColorKit copied to clipboard

EXC_BAD_ACCESS when using dominantColors() with default arguments

Open wiencheck opened this issue 3 years ago • 1 comments

When trying to fetch dominant colors from some images an exception is raised.

Screen Shot 2022-04-21 at 09 57 23

File: DominantColors.swift line 159

This is the image that's causing crash IMG_3836

In my code I just called the dominantColors() method with default arguments.

wiencheck avatar Apr 21 '22 07:04 wiencheck

Me too. Did you find a solution ?

sgousseau avatar Jul 25 '22 22:07 sgousseau

@sgousseau Fixed in #22

wiencheck avatar Dec 14 '22 08:12 wiencheck

Hi @wiencheck. I still get a crash in master branch. This is sample of code for previously mentioned image:

let url = URL(string: "https://user-images.githubusercontent.com/25985996/164407771-cbec02a2-7dc4-49ce-980b-a1f1b86d6d17.jpeg")!
let (data, _) = try await URLSession.shared.data(from: url)
let colors = try UIImage(data: data)!.dominantColors(with: .high)

There is no crash for .low and .fair qualities. Only for .high and .best.

danilsmakotin avatar Jan 20 '23 09:01 danilsmakotin