my app requirement was to take snapshots from front camera, recognize useless (too dark or monochrome) images and save them into jpeg format.
I've succesfully accomplished it on all tested device except N96... so i'm searching a reason for it... i always have a totally black image of around 9 KB....
CCamera::ImageReady() is called with aError==KErrNone; inside this method i perform a duplication:
and err == 0
TInt err = iBitmapSave->Duplicate( aBitmap->Handle() );
then i call my jpeg encoding method:
but i don't think the problem is in the jpeg conversion, because i used the same function to convert screenshots and it was (it is in fact) working fine in N96 too... but maybe screenshots and snapshot are taken into different memory areas?
* Returns a buffer with encoded jpeg image
HBufC8* CFrontCameraApp::GetImageBufferL(CFbsBitmap* aBitmap)
if (aBitmap == NULL)
// set jpeg properties
CFrameImageData* frameImageData = CFrameImageData::NewL();
TJpegImageData* imageData = new (ELeave) TJpegImageData();
imageData->iSampleScheme = TJpegImageData::EColor444;
imageData->iQualityFactor = 75; // set 90 for normal or 100 for high
// convert to jpeg synchronously
HBufC8* imageBuf = NULL;
CImageEncoder* encoder = CImageEncoder::DataNewL(imageBuf,_L8("image/jpeg"),CImageEncoder::EOptionAlwaysThread);
TRequestStatus aStatus = KErrNone;
encoder->Convert( &aStatus, *aBitmap, frameImageData );
User::WaitForRequest( aStatus );
and native camera app on N96 is taking nice snapshots in jpeg format with front camera
thank you for any hint,