Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Creating thumbnails from JPGs

    Hi,

    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?

    Regards,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  2. #2
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: Creating thumbnails from JPGs

    // Create the CFbsBitmap with the thunbmail size
    //CFbsBitmap *iBitmap;
    iBitmap = CFbsBitmap::NewL();
    iBitmap->Create...

    // Create the decoder
    // CImageDecoder *iDecoder
    delete iDecoder;
    iDecoder = NULL;
    iDecoder = CImageDecoder::FileNewL(iFs, _L("e:\\file.jpg"));

    iDecoder->Convert(&iStatus, *iBitmap);
    SetActive();
    ...


    // This is asynchronous, you have to do rest of the part in RunL

  3. #3
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: Creating thumbnails from JPGs

    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

  4. #4
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    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 ?).

    Thanks!

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  5. #5
    Regular Contributor
    Join Date
    May 2004
    Posts
    462

    Re: Creating thumbnails from JPGs

    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.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    Hi,

    any idea what is happening ? If I do:

    TSize size(42, 42);

    iBitmap->Create(size, frmInfo.iFrameDisplayMode);

    to create the thumbnail I get KErrArgument (-6) in RunL after calling
    iDecoder->Convert(&iStatus, *iBitmap);

    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.

    Regards,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,808

    Re: Creating thumbnails from JPGs

    Quote Originally Posted by heuven
    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 mentions
    Quote Originally Posted by SDK Help
    A bitmap that will contain the decoded frame. The bitmap must be created before the call and must be large enough for the frame and set to the required display mode. FrameInfo() can be used to obtain the size and display mode of the frame.
    Check CImageTransform and/or CBitmapScaler in the SDK Help.

  8. #8
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    Thanks! Good pointer. I will check these classes.

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  9. #9
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    BTW: from which SDK Help did you get that text? I cannot find it in my documentation (SDK Help). I am using S60_3rd:com.nokia.com.

    BR,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  10. #10
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    For CImageTransform:

    if I use the option EThumbNail - what will be the size of this thumb nail? Or what is the effect of the option?

    BR,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  11. #11
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    Hi,

    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);
    iTransform->SetSourceFilenameL(iFileName);

    CLogFile::LogEvent(_L("Transform entry 1"));
    (A) iTransform->SetPluginUidL(
    TUid::Uid(KUidTransformJpegPluginUidValue));
    CLogFile::LogEvent(_L("Transform entry 2"));
    (B) iTransform->SetSourceImageTypeL(
    TUid::Uid(KJPGImageDataUidValue));
    CLogFile::LogEvent(_L("Transform entry 3"));
    iTransform->SetDestFilenameL(iDestName);
    CLogFile::LogEvent(_L("Transform entry 4"));
    iTransform->SetDestSizeInPixelsL(TSize(60, 60));
    CLogFile::LogEvent(_L("Transform entry 5"));

    TRAPD(err, iTransform->SetupL());

    I get the same result when I comment (A) and (B).

    BR,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,808

    Re: Creating thumbnails from JPGs

    The help is from S60 3rd MR. I have not used CImageTransform, it has just looked appealing to me :-)

  13. #13
    Registered User
    Join Date
    Mar 2003
    Location
    Luttenberg (Netherlands)
    Posts
    577

    Re: Creating thumbnails from JPGs

    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!

    Regards,

    Rene
    Rene Heuven
    Inmote - Creative Smartphone Solutions
    Web: www.inmote.com
    E-mail: rene@inmote.com

  14. #14
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    74

    Re: Creating thumbnails from JPGs

    Hi all,

    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

Similar Threads

  1. Problem during creating .jar file in JBuilder
    By sachinwarang in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-04-17, 15:06
  2. Error in creating thumbnails
    By Juwita in forum Symbian
    Replies: 0
    Last Post: 2005-08-12, 03:02
  3. abld make files missing
    By dalore in forum Symbian
    Replies: 0
    Last Post: 2003-06-13, 12:40
  4. abld command
    By kollar in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2003-02-03, 08:51
  5. Problem with bldmake bldfiles for Series 60 SDK 6.1
    By dml in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 1970-01-01, 01:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×