contentful-labs / Concorde

Download and decode progressive JPEGs on iOS.
MIT License
1.44k stars 152 forks source link

Grey Placeholders forever? #6

Open ghost opened 9 years ago

ghost commented 9 years ago

Hello!

I have been trying to use Concorde in a iOS project with the following code:

if let url = NSURL(string: produto.imagem!.url!){
        let imagem = CCBufferedImageView(frame: cell.imageView!.frame)
        imagem.load(url)
        cell.addSubview(imagem)
}

produto.imagem is a Contentful Asset and url value currently is: url NSURL "https://images.contentful.com/765kywdqo8as/1u0UQOzrSEyAIYoY8CgaiU/743112ca52714a9739b7550fb83a43e2/3479738_wallsPetroleum_01.png" 0x00007feba3861590

When I execute my code I only get grey placeholders and never an image.

On the other hand I have tried using ContentfulPersistence with the following code:

let imagem = CCBufferedImageView(frame: cell.imageView!.frame)
imagem.cda_setImageWithPersistedAsset(produto.imagem!, client: source!.client, size: imagem.frame.size, placeholderImage: nil)
cell.addSubview(imagem)

Then I get the following error: fatal error: should never be called: file /Users/rafael/Trabalho/Bier Leverpilsen/Pods/Concorde/Code/CCBufferedImageView+Contentful.swift, line 18

Any help would be appreciated! I have been struggling for a while!

neonichu commented 8 years ago

Sorry I missed this, are you still experiencing this issue?

rafagsiqueira commented 8 years ago

Yes, I am still experiencing this issue!

rafagsiqueira commented 8 years ago

I think I have made further progress. My Asset was nil, now it actually contains the correct data but I am now getting this error:

EXC_BAD_INSTRUCTION at line 71 of CCBufferedImageView.swift: CGContextDrawImage(context, CGRectMake(0, 0, 1, 1), decodedImage.CGImage) fatal error: unexpectedly found nil while unwrapping an Optional value

decodedImage is nil.