Hi All,
I'm trying to develop a file browser application which has to open the image files. On part of it now I'm trying to convert .jpg to bitmap.
I used CImageDecoder, CFbsBitmap and ActiveObject for conversion. But resulted in exception.
So started to debug my code on the device, it shows (Suspended: Signal 'Exception 0' received. Description: A data abort exception has occured) on the line SetActive() which I called after iBitmap->Create(...); The code is attached below for your reference.
Could anyone help me, how to get out of this exception.
Thanks in advance.
Regards,
SA
Code:
void CHelloActive::BeginDecodeL(const TDesC& iFilename)
{
TInt errVal(KErrNone);
TBuf8<255>MimeType;
TRAP(errVal,CImageDecoder::GetMimeTypeFileL(iFs,iFilename,MimeType));
if(errVal == KErrNone)
{
// image decoder user for reading the image file to a bitmap
iImageDecoder = CImageDecoder::FileNewL(iFs,iFilename,MimeType);
if(iImageDecoder->FrameCount() > 0)// check that we have image(s) in the file
{
iBitmap = new(ELeave)CFbsBitmap();
iBitmap->Create(iImageDecoder->FrameInfo(0).iOverallSizeInPixels,iImageDecoder->FrameInfo(0).iFrameDisplayMode);
iImageDecoder->Convert(&iStatus,*iBitmap,0);
SetActive();
}
else
{ // indicate that we didn't find any images inside the file
TRequestStatus* status=&iStatus;
User::RequestComplete(status, KErrNotFound);
SetActive();
}
}
else // indicate that we had an error
{
TRequestStatus* status=&iStatus;
User::RequestComplete(status, errVal);
SetActive();
}
}



