Archived:Displaying EXIF version 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}}.

Article Metadata
Tested with
Devices(s): All (S60 3rd Edition)
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Created: User:Technical writer 1 (30 Apr 2008)
Last edited: hamishwillee (15 Jun 2012)


EXIF version information in image metadata is stored as a 4-byte (32-bit integer) ASCII string, which is not NULL-terminated. The following solution shows how to extract this information using CExifRead and convert it to a unicode descriptor for displaying purposes.


 #define KEXIFVersionInfoLength 4
 #include <exifread.h>     // for CExifRead (ExifLib.lib)
 #include <utf.h>          // for CnvUtfConverter (charconv.lib)
 // imageData is a buffer containing the image data
 CExifRead* exifRead = CExifRead::NewL( imageData );
 TUint32 exifVersion = 0;
 TBuf8<KEXIFVersionInfoLength> exifVerDes8;
 TBuf<KEXIFVersionInfoLength> exifVerDes;
 TInt err = exifRead->GetExifVersion( exifVersion );
 CleanupStack::PopAndDestroy(2); // exifRead, imageData
 if(err == KErrNone)
   // Copy to a temporary UTF-8 string and convert to unicode descriptor
   exifVerDes8.Copy( (TUint8*)&exifVersion, KEXIFVersionInfoLength );  
   CnvUtfConverter::ConvertToUnicodeFromUtf8( exifVerDes, exifVerDes8 );
   // Error handling
This page was last modified on 15 June 2012, at 01:30.
36 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.