-[UIImage resizableImageWithCapInsets:] logs unhelpful CoreGraphics errors when insets are bigger than the image.
| Originator: | mark | ||
| Number: | rdar://15298058 | Date Originated: | 2013-10-23 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.0.2 |
| Classification: | Other Bug | Reproducible: | Always |
Summary: NB. This problem is reproducible when running on device but not in the iOS simulator. Tested and reproduced on iOS 7.0.2. Calling -[UIImage resizableImageWithCapInsets:] with insets which touch, overlap or exceed the bounds of the source image cause Core Graphics to log a large number of polite, yet slightly ominous and rather unhelpful, error messages. These messages did not help in tracking down the problem. Steps to Reproduce: 1. In an iOS project (or using the attached sample project), instantiate a UIImage from an image file. 2. Call -[UIImage resizableImageWithCapInsets:] on the image, giving it insets which are too large for it. 3. Run on device and observe the log. 4. Modify the insets to fit within the image. 5. Run on device again and observe the lack of errors to the log. Expected Results: Useful feedback to allow the developer to track down the problem. I suggest that at least a specific error message be logged (e.g., "-[UIImage resizableImageWithCapInsets:] called with invalid insets for image"). Even more helpfully, return nil from the method to make the developer more likely to notice the issue. Consider throwing an exception? Actual Results: Example extract error log attached. The error messages logged are almost entirely unhelpful in identifying the problem. Version: 7.0.2 (11A501) Notes: Configuration: Running on device, specifically.
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!