Archived:Displaying EXIF version information using Symbian C++
Archived: 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
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
}


(no comments yet)