Namespaces
Variants
Actions

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

Jump to: navigation, search
MultiMediaTile.png
Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition
S60 3rd 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.
92 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved