Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8246] iOS: CGcontext errors, while using any background property on label

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-09T03:37:35.000+0000
Affected Version/sRelease 1.8.2, Release 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-12 API
ComponentsiOS
Labelsapi, module_label, qe-testadded
ReporterDevang Gandhi
AssigneeVishal Duggal
Created2012-03-23T13:19:20.000+0000
Updated2013-11-07T05:28:55.000+0000

Description

When any of the background property is applied on the label, we see CGcontext errors in the console. source code:
var win1 = Titanium.UI.createWindow({  
    backgroundColor:'white'
});

var l2 = Titanium.UI.createLabel({
    text:'Appcelerator',
    backgroundColor:'red',
    backgroundImage:'flower.jpg',
    height:'auto',
    width:'auto',
    color:'#900',
    font:{fontSize:48},
    textAlign:'center'
});
win1.add(l2);
win1.open();
Crash Log:
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov  3 21:59:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 10502.
[DEBUG] reading stylesheet from: /Users/dgandhi/Library/Application Support/iPhone Simulator/5.0/Applications/D35A6348-7A0B-4279-87CF-2F268969C6CD/videplayer.app/stylesheet.plist
[INFO] test/1.0 (2.0.0.v20120321121811.9b41dde)
[DEBUG] Analytics is enabled = YES
[DEBUG] loading: /Users/dgandhi/Library/Application Support/iPhone Simulator/5.0/Applications/D35A6348-7A0B-4279-87CF-2F268969C6CD/videplayer.app/app.js, resource: app_js
Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGContextConcatCTM: invalid context 0x0
Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGContextDrawImage: invalid context 0x0
Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGBitmapContextCreateImage: invalid context 0x0
[DEBUG] application booted in 44.771016 ms

Comments

  1. Junaid Younus 2012-05-21

    Tested with 2.0.1GA2 on the iOS simulator (had to do this via Xcode), issue still reproducible.
  2. Max Stepanov 2012-06-05

    PR merged https://github.com/appcelerator/titanium_mobile/pull/2319
  3. Dustin Hyde 2012-06-23

    Closing as Fixed. SDK: 2.1.0.v20120622174154 Studio: 2.1.0.201206221045 OS: Lion 10.7.4 Xcode: 4.3.2 Devices Tested: iPod 4.3.3, iPad3 5.1.1 Test Steps 1. Run sample code above. 2. Check console for errors of this type:
       Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGContextConcatCTM: invalid context 0x0
       Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
       Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGContextDrawImage: invalid context 0x0
       Mar 23 14:11:06 dgandhimbp test[10502] <Error>: CGBitmapContextCreateImage: invalid context 0x0
       
    Expected Result: No CGContext errors.
  4. Neha Chhabra 2012-07-09

    Reopening to update labels.
  5. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4787

JSON Source