When using the following method to create a resizable image
| Originator: | madewulf | ||
| Number: | rdar://25678519 | Date Originated: | |
| Status: | Resolved: | ||
| Product: | iOS | Product Version: | iOS 9.3.1 (13E238) |
| Classification: | Reproducible: | yes |
Summary: When using the following method to create a resizable image UIImage * image = [[UIImage imageNamed:@"pill"] resizableImageWithCapInsets:UIEdgeInsetsMake(17.5, 17.5, 17.5, 17.5)]; you can see lots of logs output in the console, like the ones that I copied here under. These logs would not be so annoying if later on when rendering the image after leaving and redisplaying a view controller including it, the image was not rendering incorrectly. In the case of the image included in the sample project, I would loose the rounded corners, for example. The error logs will disappear when using integer insets. (Using 18 instead of 17.5 fixes the problem). The bug only happens on device, I have seen it on iPhone 6 and iPhone 6S+ Apr 12 13:59:23 TestFloat[392] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextClipToRect: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextDrawTiledImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextGetCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextClipToRect: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextDrawTiledImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Apr 12 13:59:23 TestFloat[392] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Steps to Reproduce: Open the included project an run it on iPhone 6 under iOS 9.3.1 Expected Results: No warnings, no rendering problem. Actual Results: Warnings and rendering problems. Version: iOS 9.3.1 (13E238) Notes: Configuration: iPhone 6 GSM under iOS 9.3.1
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!