×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Using Exif API for Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
lpvalente (Talk | contribs)
m (Lpvalente -)
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
[[Category:Symbian C++]][[Category:Code Examples]][[Category:S60 3rd Edition FP1]][[Category:Code Snippet]][[Category:Graphics]]
__NOEDITSECTION__
+
{{Archived|timestamp=20120313125909|user=roy.debjit| }}
 
+
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|-
+
|'''ID''' ||
+
|'''Creation date''' || May 12, 2008
+
|-
+
|'''Platform''' || S60 3rd Edition, MR
+
|'''Tested on devices''' || Nokia N95
+
|-
+
|'''Category''' || Symbian C++
+
|'''Subcategory''' ||
+
|-
+
|}
+
 
+
 
+
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|-
+
|'''Keywords (APIs, classes, methods, functions):''' CExifRead
+
|}
+
  
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= [[Media:GeoTagging Example.zip]]
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= Nokia N95
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|platform= S60 3rd Edition, MR
 +
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= CExifRead
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080520
 +
|author= [[User:Tepaa]]
 +
<!-- The following are not in current metadata -->
 +
|id= CS000968
 +
}}
 +
 
 
==Overview==
 
==Overview==
CExifRead Interface class for parsing Exif v2.2 file format.  
+
{{Abstract|The CExifRead Interface class is used for parsing the Exif v2.2 file format. With this API you can read data from JPEG images, such as date, resolution, orientation, ISO speed, and exposure time.}}
Via this API you can read data from JPEG images e.g. date, resolution,
+
orientation, ISO speed, exposure time...
+
  
 
==MMP file==
 
==MMP file==
 
The following capabilities and libraries are required:
 
The following capabilities and libraries are required:
 
<code cpp>
 
<code cpp>
CAPABILITY       NONE
+
CAPABILITY NONE
LIBRARY           efsrv.lib
+
LIBRARY efsrv.lib
LIBRARY           exiflib.lib
+
LIBRARY exiflib.lib
 
</code>
 
</code>
  
Line 124: Line 128:
  
 
==Postconditions==  
 
==Postconditions==  
Exif data readed from given image.
+
Exif data read from the given image.
  
 
==See also==
 
==See also==
[http://www.forum.nokia.com/document/CDL_Extension_S60_3rd_Ed_FP2/GUID-C89505CF-D5FE-4C89-95D4-692443563021/html/Exif_API4.html Exif API]
+
[http://library.developer.nokia.com/index.jsp?topic=/S60_3rd_Edition_Cpp_Developers_Library/GUID-CEE609D8-50E3-422D-8FF9-42C25D669E59_cover.html Exif API]
 
+
[http://wiki.forum.nokia.com/index.php/Image:GeoTagging_Example.zip GeoTagging_Example.zip]
+
  
[[Category:Symbian C++]][[Category:Code Examples]]
+
[[File:GeoTagging Example.zip]]

Latest revision as of 21:09, 1 September 2012

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
Code ExampleTested with
Devices(s): Nokia N95
Compatibility
Platform(s): S60 3rd Edition, MR
S60 3rd Edition FP1
Article
Keywords: CExifRead
Created: tepaa (20 May 2008)
Last edited: lpvalente (01 Sep 2012)

Contents

[edit] Overview

The CExifRead Interface class is used for parsing the Exif v2.2 file format. With this API you can read data from JPEG images, such as date, resolution, orientation, ISO speed, and exposure time.

[edit] MMP file

The following capabilities and libraries are required:

CAPABILITY NONE
LIBRARY efsrv.lib
LIBRARY exiflib.lib

[edit] Header file

Class for reading Exif data.

#include <exifread.h>
#include <f32file.h>
 
class CMyExifReader : public CBase
{
public:
static CMyExifReader* NewL();
static CMyExifReader* NewLC();
virtual ~CMyExifReader();
private:
CMyExifReader();
void ConstructL();
public:
void ReadExifDataL(TDesC& aFilename);
 
public:
HBufC8* iImageDescription;
HBufC8* iImageDate;
 
};

[edit] Source file

CMyExifReader::CMyExifReader()
{
}
 
CMyExifReader* CMyExifReader::NewL()
{
CMyExifReader* self = NewLC();
CleanupStack::Pop();
return self;
}
 
CMyExifReader* CMyExifReader::NewLC()
{
CMyExifReader* self = new (ELeave) CMyExifReader();
CleanupStack::PushL( self );
self->ConstructL();
return self;
}
 
void CMyExifReader::ConstructL()
{
}
 
CMyExifReader::~CMyExifReader()
{
delete iImageDescription;
delete iImageDate;
}
 
void CMyExifReader::ReadExifDataL(TDesC& aFilename)
{
// 1. Read Exif image from the file to a buffer
RFile file;
User::LeaveIfError( file.Open( CEikonEnv::Static()->FsSession(), aFilename, EFileRead ) );
CleanupClosePushL( file );
TInt size = 0;
file.Size(size);
HBufC8* exif = HBufC8::NewL( size );
CleanupStack::PushL( exif );
TPtr8 bufferDes( exif->Des() );
User::LeaveIfError( file.Read( bufferDes ) );
CleanupStack::Pop( exif );
CleanupStack::PopAndDestroy(); // file
CleanupStack::PushL( exif );
 
// 2. Instantiate Exif reader...
CExifRead* read = CExifRead::NewL( exif->Des() );
CleanupStack::PushL( read );
 
// 3. Get required data from the Exif image...
TInt err = KErrNone;
TRAP(err,iImageDescription = read->GetImageDescriptionL());
TRAP(err,iImageDate = read->GetDateTimeL());
// TODO: See CExifRead API for getting more data from image
 
// 4. Delete the reader instance...
CleanupStack::PopAndDestroy( read );
CleanupStack::PopAndDestroy( exif );
}

[edit] Postconditions

Exif data read from the given image.

[edit] See also

Exif API

File:GeoTagging Example.zip

This page was last modified on 1 September 2012, at 21:09.
82 page views in the last 30 days.