How to minimise loading time of jpeg image. | developer.brewmp.com How to minimise loading time of jpeg image. | developer.brewmp.com

Developer

How to minimise loading time of jpeg image.

Forums:

Hello Friends,

We are developing one application, in which we want to resize jpg file and convert it in to bmp.
For this procedure we are loading the jpeg file in one function and assigning one call back function with Image notify. But we are facing one performance related problem in it.
It is taking 3-4 seconds to load the jpg image taken by the camera,with the resolution 1.3 MPixels. The size of file created is near about 150 KB.
We have tested it on Motorola V3C and Motorola K1M devices.Is there any possible way to reduce the loading time of Jpg image?

The sample code is as follows:-

Approach 1: Load the image by ISHELL_LoadImage

LoadImage(char* FileName)
{
IImage* jpgImage;
jpgImage=ISHELL_LoadImage(GETISHELL(),FileName);
IIMAGE_Notify(jpgImage, (PFNIMAGEINFO)jpegCallBack, this);

}

Approach 2:Load the image by useing IMEMSTREAM.

LoadImage(char* Buffer)
{
IImage* jpgImage;
ISHELL_CreateInstance(GETISHELL(),AEECLSID_MEMASTREAM,(void**)&memStream);
IMEMASTREAM_SetEx(memStream, (byte*)pBuffer, iSize, 0, NULL, this);
IIMAGE_SetStream(jpgImage,(IAStream *)memStream);
IIMAGE_Notify(jpgImage, (PFNIMAGEINFO)jpegCallBack, this);

Approach 3: Load the image by using File pointer.

LoadImage(char* FileName)
{
IFileMgr* m_pIFileMgr=NULL;
IFile* m_pIFile=NULL;
byte* buffer=NULL;
FileInfo fileInfo;
m_pIFileMgr=GETFILEMGR();
if(pBuffer)
{
m_pIFile = IFILEMGR_OpenFile(m_pIFileMgr, FileName, _OFM_READ);
if(!m_pIFile)
return JPGERROR3;
}
IIMAGE_SetStream(jpgImage,(IAStream *)m_pIFile);
IIMAGE_Notify(jpgImage, (PFNIMAGEINFO)jpegCallBack, this);

By all the three approaches we get the time to load the image is about three to four seconds. So that our total time of resizeing and converting it to bmp is increased significantly.
Is there any possible way to load the jpg image faster and to resize and convert to bmp.

Thanks and Regards,
Jayawant Jagtap