Archived:Displaying image information using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Remove from Archive?: This article has been marked for removal from archive, for the following reasons:
I believe the information is still accurate in current versions.

Article Metadata
Tested with
Devices(s): Nokia E61i
Nokia E90 Communicator
Nokia N95 8GB
Platform(s): S60 3rd Edition, MR
S60 3rd Edition, FP1
S60 3rd Edition, FP2 Beta
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Keywords: CFrameInfoStrings, CImageDecoder::FileNewL(), CImageDecoder::FrameInfoStringsL()
Created: tapiolaitinen (20 Mar 2008)
Last edited: hamishwillee (06 Aug 2012)



This code snippet demonstrates how to obtain and display the following information about an image:

  • Decoder
  • Format
  • Dimensions
  • Color depth
  • Details

MMP file

The following libraries are required:

LIBRARY imageconversion.lib

Header file

* Obtains the image info
* @param aFs a reference to the file server session
* @param aFilename the filename of the image
* @return image info as CFrameInfoStrings*

CFrameInfoStrings* CApp::GetImageInfoL(RFs& aFs, const HBufC& aFilename);

Source file

#include <ImageConversion.h>
const TInt KMaxInfoDescriptorLength = 80;
// Obtains the image info from the image referenced by the aFilename
CFrameInfoStrings* CApp::GetImageInfoL(RFs& aFs, const HBufC& aFilename)
CImageDecoder* decoder = CImageDecoder::FileNewL(aFs, aFilename);
CFrameInfoStrings* info = decoder->FrameInfoStringsL();
return info;
// Connect a client process to the fileserver
RFs fsSession;
// Obtain the image info
_LIT(KLITFilename, "C:\\Data\\Images\\image.jpg");
const HBufC* KFilename = KLITFilename().Alloc();
CFrameInfoStrings* info = GetImageInfoL(fsSession, *KFilename);
// Display the info items one by one
for (TInt i = 0; i < info->Count(); i++)
TBuf<KMaxInfoDescriptorLength> infoItem;
CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue);
// Clean up
CleanupStack::PopAndDestroy(2); // info, fsSession


Image information is displayed.

This page was last modified on 6 August 2012, at 04:56.
60 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.