I have some more information that may be helpful, although it just confuses me more. The above code is in the second scene of the app, the first is a splash screen. JPGs work fine in the splash screen. And if I load the jpg from the splash screen in the code above, everything works fine.
I even replaced the line that sets the position to this:
bg->setPosition(ccp( CCDirector::sharedDirector()->getWinSize().width/2,CCDirector::sharedDirector()->getWinSize().height/2 ));
And the image still appears in the bottom left of the screen. Again, PNGs work fine and the problem only happens on the device, not the simulator.
I have another game, in that one, the jpg background on the first and second scenes work fine. But the one on the third scene doesn’t. That one creates the background in a second function that is called from the init() function. In that one, even if I set the coordinates manually, the image doesn’t display right. It is centered vertically correctly, but not horizontally.
To me, it seems like a memory issue, like something is getting overwritten that shouldn’t be. But I have no idea how to track that down.