How can I access metadata in JPEG images using Symbian C++
Article Metadata
Compatibility
S60 2nd Edition
S60 3rd Edition
Article
Overview
JPEG (or other formats, such as GIF and PNG) images can contain metadata information. This solution describes how to access metadata from the code.
Description
In S60 1st Edition, there is no interface that could be used to obtain the metadata of the image.
In S60 2nd Edition, the text comments added as metadata can be obtained with the CImageDecoder's ImageCommentL method.
Solution
Example code for S60 2nd Edition:
HBufC* CImageHandler::GetMetaDataL(RFs& aFs, const TFileName& aFileName, TInt aIndex)
{
CImageDecoder* decoder =
CImageDecoder::FileNewL(aFs, aFileName);
CleanupStack::PushL(decoder);
HBufC* metaData = NULL;
if (aIndex >= 0 && aIndex < decoder->NumberOfImageComments())
{
metaData = decoder->ImageCommentL(aIndex);
}
CleanupStack::PopAndDestroy(); // decoder
return metaData;
}


(no comments yet)