Saving an FBO as image

Hey,
Trying to save an FBO as an image and i’m getting an empty file (zero bytes),
I tried several different methods and they all produce the same result for some reason.

I have three parts:
setup where I init everything:
camImage.allocate(640, 480,GL_RGBA);
camImage.begin();
ofClear(255, 255, 255,255);
camImage.end();
initImage.allocate(640, 480,ofImageType::OF_IMAGE_COLOR_ALPHA);

drawing - where I check eventually something is in the fbo:
camImage.begin();
// ofClear(255,255,255,255);
video.draw(0, 0);
// ofSetColor(255, 0, 0);
// ofDrawRectangle(0, 0, 100, 100);
camImage.end();
ofPixels newPix;
camImage.readToPixels(newPix);
initImage.setFromPixels(newPix);

  camImage.draw(0, 0);

and a function that is being called with a keypress that basically does this:
initImage.save(“newPix.jpg”);

any ideas what am I missing that produce an empty image ?
thanks in advance

Amit

Stupidly solved it by changing the file format to .png :pensive: