The need comes from the following problem:
Sprite 'sprite1' is initialized
CCSprite *sprite1 = [CCSprite spriteWithFile:@"s40x40.png"]; // 40x40 sprite
But later on I need to reload spite1 with different texture of the random sprite.
sprite1.texture = [[CCTextureCache sharedTextureCache] addImage:@"random.png"]
Now to display 'sprite1' correctly the size of the TextureRect has to be adjusted to the size of the 'random.png'
[sprite1 setTextureRect:CGRectMake(0.0f, 0.0f, x, y) ];
How can I retrieve the x, y from 'random.png' ?