×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    15

    How to write/change EXIF data

    Hi,

    I want to modify/write EXIF data. if I have understand EXIF API can be found in symbian 3rd Edition.

    There is CJPEGExifEncoder but ICLExif.h can not found in SDK:s.

    How the EXIF API can be used?

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: How to write/change EXIF data

    Yes you are right. The header file ICLExif.h and the LIB file jpegexifplugin.lib is not available in the public SDKs, it's internal to Nokia. May be you can ask in this section: Developers Platform Feedback (Series 40, Series 80 and S60 Platforms).

  3. #3
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: How to write/change EXIF data

    Well, I have not used the API myself but the documentation is pretty clear:

    Quote Originally Posted by S60 3rd Edition SDK for Symbian OS, MR API Reference Guide

    CExifModify Class Reference

    Published in S60 3rd Ed

    Link against: ExifLib.lib

    Capability Information: none

    #include <exifmodify.h>

    Detailed Description
    CExifModify Interface class for modifying existing Exif v2.2 (or prior) file format or creating Exif v2.2 file format using valid Jpeg image.
    An instance of this class can be instantiated in one of two ways: by providing valid Exif data or by providing valid Jpeg image.


    Dll ExifLib

  4. #4
    Registered User
    Join Date
    Feb 2006
    Posts
    15

    Question Re: How to write/change EXIF data

    Hi,

    I have tested to use CExifModify the following simple code:

    RFile file;
    file.Open( CEikonEnv::Static()->FsSession(),
    _L("C:\\test.jpg"), EFileRead );

    TInt fileSize;
    file.Size( fileSize );
    HBufC8* buff = HBufC8::NewL( fileSize );
    TPtr8 tprBuff = buff->Des();

    file.Read(tprBuff);
    file.Close();

    CExifModify* modify = CExifModify::NewL( tprBuff);
    modify->SetImageDescriptionL( _L8("Test") );

    file.Replace(CEikonEnv::Static()->FsSession(),
    _L("C:\\test2.jpg"), EFileWrite );
    file.Write(tprBuff);

    file.Close();
    delete modify;
    delete buff;


    Program stops in CExifModify* modify = CExifModify::NewL( tprBuff) line.

    Have anyone else tested the API?

  5. #5
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: How to write/change EXIF data

    Quote Originally Posted by 3rdparty

    Program stops in CExifModify* modify = CExifModify::NewL( tprBuff) line.

    Have anyone else tested the API?
    This is hardly an acurate description of your problem(s). What do you mean by "program stops": a panic, a leave ? Was there an error code ? Was it happening on device, on emulator or on both?

    Here is a working piece of code:
    Code:
    case ECommand2:
    	{
    	
    	RFs fsSession;
    	RFile rFile;
    	TInt fileSize = 0;
    	HBufC8* buff = NULL;
    	HBufC8* newExif = NULL;
    				
    	// Connects a client process to the fileserver
    	User::LeaveIfError(fsSession.Connect());
    	CleanupClosePushL(fsSession);
    	
    	User::LeaveIfError(rFile.Open( fsSession, _L("C:\\test.jpg"), EFileRead ));
    	rFile.Size( fileSize ); 
    
    	buff = HBufC8::NewLC( fileSize);
    	TPtr8 tprBuff = buff->Des();
    	
    	rFile.Read(tprBuff); 
    	rFile.Close();
    	
    	CExifModify* modify = CExifModify::NewL( tprBuff);
    	CleanupStack::PushL(modify);
    	
    	modify->SetImageDescriptionL( _L8("TestS60App") );
    	modify->SetMakeL( _L8("Nokia S60") );
    	
    	newExif = modify->WriteDataL(tprBuff);
    	CleanupStack::PushL(newExif);
    	
    	User::LeaveIfError(rFile.Replace( fsSession, _L("C:\\test2.jpg"), EFileWrite ));
    	rFile.Write(*newExif);
    	rFile.Close();
    	
    	// Pop loaded resources from the cleanup stack
    	CleanupStack::PopAndDestroy(4, &fsSession); // newExif, modify, buff, fsSession 
    	
    	}
    	break;
    This is the input EXIF data:
    Code:
    File: - c:\Symbian\9.1\S60_3rd_MR_2\Epoc32\winscw\c\test.jpg
    
    Make - Nokia
    Model - N90-1
    Orientation - Top left
    XResolution - 300
    YResolution - 300
    ResolutionUnit - Inch
    ...
    and this is the resulting EXIF:
    Code:
    File: - c:\Symbian\9.1\S60_3rd_MR_2\Epoc32\winscw\c\test2.jpg
    
    ImageDescription - TestS60App
    Make - Nokia S60
    Model - N90-1
    Orientation - Top left
    XResolution - 300
    YResolution - 300
    ResolutionUnit - Inch
    ...
    Last edited by ltomuta; 2006-11-03 at 15:27.

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    13

    Re: How to write/change EXIF data

    Quote Originally Posted by ltomuta
    This is hardly an acurate description of your problem(s). What do you mean by "program stops": a panic, a leave ? Was there an error code ? Was it happening on device, on emulator or on both?
    hi ltomuta,
    i'm trying the codes u provided
    but it seems i'd met the same problem as 3rdparty
    i'm work on the emulator and
    the program LEAVES at the line of CExifModify* modify = CExifModify::NewL( tprBuff)
    and there was no error code.

    so.. can u pls kindly show me where goes wrong? THANK U

  7. #7
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: How to write/change EXIF data

    An unhandled leave will end up on your screen as a user friendly message. Was there one? You can also trap it and thus see the error value.

    As you can see from the above example the input picture (test.jpg) had a EXIF structure already and I was using the API to add or modify entries. As such the NewL method uses the default value for the second parameter, aOperationMode = EModify. If for the same piece of code the input JPG does not have a EXIF structure the method will leave with KErrCorrupt (-20). I wonder how is it that I can see this error code... maybe because I've read the "Tips & Tricks" sticky

    This was a quick check I've done but unfortunately I do not have time to spend investigating this further and other leave condition may exist. Since the above mentioned leave is not documented you have now a good reason to complain about this on the feedback forum. If you run into more problems using the API opening a technical support case is always a good option.

    Best regards,

  8. #8
    Registered User
    Join Date
    Feb 2007
    Posts
    4

    Unhappy Re: How to write/change EXIF data

    Thanks for posting a working example.
    I have the requirement of reading the Exif Data. I follow the steps as mentioned in the thread and I use CExifRead as follows.
    CExifRead* reader =
    CExifRead::NewL( tprBuff, CExifRead::EFastJpegParsing );
    I get system error -20 for the read call.

    Any pointers would be appreciated.

    Thanks in advance!

    Regards.

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: How to write/change EXIF data

    a bit late answer, basically the error indicates that the image does not have Exif information in it yet, so you cna not make a reader.

    all and all if you are interested on the topic, there is example available at the wiki: http://wiki.forum.nokia.com/index.ph...ng_Example.zip

  10. #10
    Registered User
    Join Date
    Feb 2005
    Posts
    35

    Re: How to write/change EXIF data

    I think there are more undocumented leave conditions for this API.

    For instance CExifModify::NewL will leave with KErrNotSupported when passed data from this file: http://wiki.forum.nokia.com/index.ph...tSupported.jpg

    Also CExifModify::WriteDataL will leave with KErrNoMemory when passed data from this file: http://wiki.forum.nokia.com/index.ph...rrNoMemory.jpg

    Tested on a N95 device and FP2 emulator.

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: How to write/change EXIF data

    it should work nicely at least with the images taken with phones own camera, could be that some formats are not supported.

    Also, you need to remember that there is two separate limits of memory, which can cause KErrNoMemory error when exceeded. The processes own max heap limit and the max available RAM, thus which ever is small will define the max size of the image.

  12. #12
    Registered User
    Join Date
    Feb 2005
    Posts
    35

    Re: How to write/change EXIF data

    Very good point, symbianyucca. Thanks !

    Adding a proper EPOCHEAPSIZE statement in my MMP file takes care of the KErrNoMemory condition. The default 1MB max heap size is not sufficient to process high resolution images produced by N95, because apparently "While getting out the whole Exif image using the CExifModify function, the instant memory consumption may reach up to twice the JPEG image data size.", according to some Nokia doc.

Similar Threads

  1. suckho, i have encontered the same problems. Could you tell me how you resolved it?
    By dicson_hu in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-12-09, 10:56
  2. GPRS connection problems on 6600..
    By suckho in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2005-12-02, 14:00
  3. Nokia 6600 Socket Server send delay Problem
    By dicson_hu in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-31, 07:37
  4. Replies: 2
    Last Post: 2004-09-15, 22:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×