×
Namespaces

Variants
Actions

How can I access metadata in JPEG images using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition
S60 3rd Edition
S60 3rd Edition (initial release)
S60 2nd Edition (initial release)
S60 1st Edition
Article
Created: User:Technical writer 2 (24 May 2005)
Last edited: hamishwillee (14 Jun 2013)

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;
    }

This page was last modified on 14 June 2013, at 09:00.
52 page views in the last 30 days.