Sdwebimage: always crash

Created on 18 Apr 2018  路  2Comments  路  Source: SDWebImage/SDWebImage

sdwebImage version 4.1.2
error stack:

0聽CoreGraphics | _ERROR_CGDataProvider_BufferIsNotReadable聽+聽16
-- | --
1聽CoreGraphics | CGDataProviderRetainBytePtr聽+聽216
2聽QuartzCore | CA::Render::(anonymous namespace)::create_image_from_image_data(CGImage*, CGColorSpace*, unsigned int, unsigned int, double)聽+聽196
3聽QuartzCore | CA::Render::create_image(CGImage*, CGColorSpace*, unsigned int, double)聽+聽868
4聽QuartzCore | CA::Render::copy_image(CGImage*, CGColorSpace*, unsigned int, double, double)聽+聽472
5聽QuartzCore | CA::Render::prepare_image(CGImage*, CGColorSpace*, unsigned int, double)聽+聽20
6聽QuartzCore | CA::Layer::prepare_commit(CA::Transaction*)聽+聽420
7聽QuartzCore | CA::Context::commit_transaction(CA::Transaction*)聽+聽576
8聽QuartzCore | CA::Transaction::commit()聽+聽580
9聽QuartzCore | CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)聽+92
10聽CoreFoundation | ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__聽+聽32
11聽CoreFoundation | ___CFRunLoopDoObservers聽+聽412
12聽CoreFoundation | ___CFRunLoopRun聽+聽1436
13聽CoreFoundation | CFRunLoopRunSpecific聽+聽552
14聽GraphicsServices | GSEventRunModal聽+聽100
15聽UIKit | UIApplicationMain聽+聽236
16聽tieba | main (main.m:36)
17聽libdyld.dylib | _start聽+聽4

I think my problem as well as #2077 .
but if I set shouldDecompressImages property to false. like below:
SDWebImageDownloader.shared().shouldDecompressImages = false
SDImageCache.shared().config.shouldDecompressImages = false

what is the disadvantage to set them? load image slow or what?

crash

Most helpful comment

OS version ? If >= iOS 11.2, seems Apple's bug...See #2226

For what actual shouldDecompressImages & scaleDownlargeImages means, see #2273

The advantage of force decode, means we can decode the image before UIImageView actual rendering it, in the background queue. If you don't do this, Core Animation will try to decode it during rendering on the main queue and reduce the frame rate.

The disadvantage is that during the force decode process, we need another CGBitmapContext and draw images. This process will cause a temporary memory peak. But this will drop down to a lower value if the decoding process finished...Only if the image resolution is large, or the concurrent decoding images count become large, the memory peak will cause OOM. (But mostly, a 500x500 images only consume 7MB, a new CGBitmapContext may contains the same memory like this. Only if you have more than 50 images to be decoding at the same time may cause the OOM)

This is a banlance between Time & Space. For most cases we enable this feature to keep frame rate. Only if you're loading something big images, you should consider to disable this.

All 2 comments

OS version ? If >= iOS 11.2, seems Apple's bug...See #2226

For what actual shouldDecompressImages & scaleDownlargeImages means, see #2273

The advantage of force decode, means we can decode the image before UIImageView actual rendering it, in the background queue. If you don't do this, Core Animation will try to decode it during rendering on the main queue and reduce the frame rate.

The disadvantage is that during the force decode process, we need another CGBitmapContext and draw images. This process will cause a temporary memory peak. But this will drop down to a lower value if the decoding process finished...Only if the image resolution is large, or the concurrent decoding images count become large, the memory peak will cause OOM. (But mostly, a 500x500 images only consume 7MB, a new CGBitmapContext may contains the same memory like this. Only if you have more than 50 images to be decoding at the same time may cause the OOM)

This is a banlance between Time & Space. For most cases we enable this feature to keep frame rate. Only if you're loading something big images, you should consider to disable this.

thanks a lot. and it only crashed OS>11.2. I will see #2273 soon. thank again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doingy picture doingy  路  4Comments

onato picture onato  路  3Comments

diogot picture diogot  路  4Comments

mohacs picture mohacs  路  5Comments

paul-lavoine picture paul-lavoine  路  4Comments