MExifMetadataReader Class Reference

#include <iclexif.h>

class MExifMetadataReader
Public Member Functions
pure virtual TInt GetIntegerArrayParam(TUint, TUint, CArrayFix< TInt > &)
pure virtual TInt GetIntegerParam(TUint, TUint, TInt &)
pure virtual TInt GetParam16(TUint, TUint, HBufC16 *&)
pure virtual TInt GetParam8(TUint, TUint, HBufC8 *&)
pure virtual TInt GetRationalArrayParam(TUint, TUint, CArrayFix< TRational > &)
pure virtual TInt GetRationalParam(TUint, TUint, TInt &, TInt &)
pure virtual TInt GetShortArrayParam(TUint, TUint, CArrayFix< TUint16 > &)
pure virtual TInt GetShortParam(TUint, TUint, TUint16 &)

Detailed Description

generic accessor to read the tags from exif metadata.

Note: The aIfd argument in MExifMetadataReader methods should be set as follows:
  • When reading an IFD 0 tag that is not a GPS tag, use KExifIfdZero.

  • When reading a tag related to thumbnail, use KExifIfdOne.

  • When reading a GPS tag, use KExifGpsIfd.

The TExifReaderUtility class offers a friendlier interface to access these tags.

See also: TExifReaderUtility

Member Function Documentation

GetIntegerArrayParam ( TUint, TUint, CArrayFix< TInt > & )

TInt GetIntegerArrayParam(TUintaTag,
TUintaIfd,
CArrayFix< TInt > &aParam
)const [pure virtual]

Get the data associated with an array of signed or unsigned 32-bit integers EXIF/DCF tag/IFD. If being used to get unsigned integers, it is up to the caller to typecast them as appropriate.

Note: aParam will be resized to fit the number of data elements read.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the array is filled with the list of values in this tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetIntegerParam ( TUint, TUint, TInt & )

TInt GetIntegerParam(TUintaTag,
TUintaIfd,
TInt &aParam
)const [pure virtual]

Get the data associated with a signed or unsigned 32-bit integer EXIF/DCF tag/IFD. If used to get unsigned data, it is up to the caller to do the appropriate typecast of aParam.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the value of the tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetParam16 ( TUint, TUint, HBufC16 *& )

TInt GetParam16(TUintaTag,
TUintaIfd,
HBufC16 *&aParam
)const [pure virtual]

Get the data associated with a 16-bit EXIF/DCF tag/IFD.

Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required.

Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership.

Note: This method is not recommended. To get 16-bit data from a tag of undefined type, it is recommended that GetParam8() be used instead. The HBufC8* returned by GetParam8() can then be converted into an HBufC16* as needed.

If this method is used, please be aware of the following:
  • It may only be used with the tags 0x9286 (UserComment), 0x001B (GpsProcessingMethod) & 0x001C (GpsAreaInformation).

  • The supported tags might not contain 16-bit data. Only use this method if you are certain that the tag contain 16-bit data. If used on a tag containing 8-bit data, the 8-bit data will be returned in the HBufC16* which will have to be manually converted to an HBufC8*.

  • The first 8 bytes of the returned HBufC16* may contain a Character Code prefix. See table 6 of the Exif 2.2 specification for a list of Character Code prefixes.

  • The length of the returned HBufC16* will include the length of the character code prefix if present.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the value of the tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetParam8 ( TUint, TUint, HBufC8 *& )

TInt GetParam8(TUintaTag,
TUintaIfd,
HBufC8 *&aParam
)const [pure virtual]

Get the data associated with an 8-bit (e.g. ASCII, Undefined or Byte) EXIF/DCF tag/IFD.

Ownership of the buffer pointed to by aParam transfers to the client, which is therefore responsible for deleting the buffer when required.

Note: The client should always initialise aParam to NULL, and the plugin should only assign to this parameter when ready to transfer ownership.

Note: If using this method to retrieve ASCII data, the returned data will not be NULL terminated.

Note: If using this method to retrieve Undefined data, the raw data will be returned, exactly as it appears in the tag value. Thus if the tag is one that includes a character code prefix, then this prefix will be included in the returned data. See table 6 of the Exif 2.2 specification for a list of character code prefixes.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the value of the tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetRationalArrayParam ( TUint, TUint, CArrayFix< TRational > & )

TInt GetRationalArrayParam(TUintaTag,
TUintaIfd,
CArrayFix< TRational > &aParam
)const [pure virtual]

Get the data associated with an array of signed or unsigned rationals EXIF/DCF tag/IFD. If used to get unsigned rational data, it is up to the client to typecast the components as appropriate.

Note: aParam will be resized to fit the number of data elements read.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the array is filled with the list of values in this tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetRationalParam ( TUint, TUint, TInt &, TInt & )

TInt GetRationalParam(TUintaTag,
TUintaIfd,
TInt &aNumer,
TInt &aDenom
)const [pure virtual]

Get the data associated with a signed or unsigned rational EXIF/DCF tag/IFD. If used to get an unsigned rational, it is up to the caller to typecast aNumer & aDenom as appropriate.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aNumeron return, the numerator value of the tag
aDenomon return, the denominator value of the tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetShortArrayParam ( TUint, TUint, CArrayFix< TUint16 > & )

TInt GetShortArrayParam(TUintaTag,
TUintaIfd,
CArrayFix< TUint16 > &aParam
)const [pure virtual]

Get the data associated with an array of unsigned short (16-bit) integers EXIF/DCF tag/IFD.

Note: aParam will be resized to fit the number of data elements read.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the array is filled with the list of values in this tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.

GetShortParam ( TUint, TUint, TUint16 & )

TInt GetShortParam(TUintaTag,
TUintaIfd,
TUint16 &aParam
)const [pure virtual]

Get the data associated with an unsigned short (16-bit) integer EXIF/DCF tag/IFD.

ParameterDescription
aTagthe tag id where the data is stored
aIfdthe ifd section in which the tag is stored.
aParamon return, the value of the tag

Returns: error code KErrArgument if the requested data type does not match with the tag. KErrNotSupported if called on an encoding module. KErrNotFound if the tag cannot be found.