Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Displaying EXIF version information using Symbian C++

From 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)
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 1 (30 Apr 2008)
Last edited: hamishwillee (15 Jun 2012)

Description

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.

Solution

 #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 );
 CleanupStack::PushL(exifRead);
 
 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 );
   }
 else
   {
   // Error handling
   }
This page was last modified on 15 June 2012, at 01:30.
34 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.

×