can someone explain how to use CImageDecoder to create thumbnails for a list of JPGs? Or should a different class be used to perform this job?
// Create the CFbsBitmap with the thunbmail size
iBitmap = CFbsBitmap::NewL();
// Create the decoder
// CImageDecoder *iDecoder
iDecoder = NULL;
iDecoder = CImageDecoder::FileNewL(iFs, _L("e:\\file.jpg"));
// This is asynchronous, you have to do rest of the part in RunL
Actually, in symbian 2.x, you can use CPAlbImageData of album class to get the image thumbnail, and in 3.0, you can use gallery class to get the thunbmail
Thanks for the answer. Actually I was hoping on some suggestion which would run a bit faster . Creating thumb nails using CImageDecoder will work for me (I think/hope). Currently I am using the MGFetch 3.0 Gallery class. On the emulator it works fine (PlatSec turned OFF). On N91 it complains that it needs DRM capability. Documentation states that this is only required if you access DRM proteced content. I do not. As a consequence I am now stuck in my planning for the application as I have to create a MGFetch-like class myself (can I invoice Nokia for this ?).
Use CImageDecoder should be slower, unless you save the thunbmail, and next time, you just load the thumbnail and donot try to decode and resize again. Album class in 2.x is very fast and stable, but you cannot find it in 3.x. I hvnot tried the gallery way to get thunbmail, by right, it should be faster. The platform will generate the thumbnail, and the gallery class might just load the thumbnail. You can find some discussion about gallery method in this forum.
any idea what is happening ? If I do:
TSize size(42, 42);
to create the thumbnail I get KErrArgument (-6) in RunL after calling
If I try to Convert the JPG with its original size it works OK. The documentation only mentions KErrUnderflow and recommends to call ContinueConvert() in that case. ContinueConvert() in my case (KErrArgument) causes a crash.
in the line above the documentation also mentionsOriginally Posted by heuvenCheck CImageTransform and/or CBitmapScaler in the SDK Help.Originally Posted by SDK Help
so I now use CImageTransform to create thumbnails from the JPG images. In the emulator everything works fine. But on a N73 SetupL() returns KErrNotFound (-1). Anyone has an idea about what the problem could be?
Here is the code:
iTransform = CImageTransform::NewL(iFs);
CLogFile::LogEvent(_L("Transform entry 1"));
CLogFile::LogEvent(_L("Transform entry 2"));
CLogFile::LogEvent(_L("Transform entry 3"));
CLogFile::LogEvent(_L("Transform entry 4"));
CLogFile::LogEvent(_L("Transform entry 5"));
I get the same result when I comment (A) and (B).
The help is from S60 3rd MR. I have not used CImageTransform, it has just looked appealing to me :-)
OK - thanks. I will install S60 3rd MR. Meanwhile I created a workaround for creating the thumbnails by using CBitmapScaler and externalize/internalize the BMPs into a file (fast ... fast ... really fast - I am satisfied).
I will park the issue with CImageTransform on a list of 'to do's/'issues'.
Many thanks for the suggestions!
We can call any function to generate a thumbnail in Gallery's secret thumbnail folder (_palbtn subdirectories). Because i have seen those secret thumbnail folders when i opened the Gallery tool on Mobile.
P/s: The thumbnails created in the _palbtn subdirectories are bitmaps in the mbm format