views:

93

answers:

1

I am new to iphone programming. using google code iphone-exif, i can read/write images tags also i can add custom image tags. But, my problem is that how can see the updated data??? OR is there any way to save image with updated data??

I have used .jpg image from net, is in other resources folder. Here my code (.m file)

NSString *filePath = @"/.../ProjectName/1.jpg"; NSMutableData *imageData = [NSMutableData dataWithContentsOfFile:filePath];

EXFJpeg* jpegScanner = [[EXFJpeg alloc] init];

[jpegScanner scanImageData: imageData];

EXFMetaData* exifData = jpegScanner.exifMetaData; //EXFJFIF* jfif = jpegScanner.jfif;

[exifData addTagValue: @"Changed MAke" forKey:[NSNumber numberWithInt:EXIF_Make]]; id val2 = [exifData tagValue:[NSNumber numberWithInt:EXIF_Make]]; NSLog(val2);

NSLog([exifData tagValue:[NSNumber numberWithInt:EXIF_Model]]); NSLog([exifData tagValue:[NSNumber numberWithInt:EXIF_DateTime]]);

// SAVE THE IMAGE WITH THE NEW TAGS [jpegScanner populateImageData:imageData]; //[imageData writeToFile:filePath atomically:YES];

A: 

After saving your new image data:

NSString *filePath = @"/.../ProjectName/1.jpg"; 
NSMutableData *imageData = [NSMutableData dataWithContentsOfFile:filePath];

EXFJpeg* jpegScanner = [[EXFJpeg alloc] init];

[jpegScanner scanImageData: imageData];

EXFMetaData* exifData = jpegScanner.exifMetaData;

id myValue = [exifData tagValue:[NSNumber numberWithInt:EXIF_Make]];
NSLog(@"My changedValue is: %@", myValue);
[jpegScanner release];
jamapag
Thanks jamapag :)But above answer not solves my question because on console, i get the updated values.1. what is the output of populateImageData()???(it is giving me as - About to append remaining data)2. is there any other way to see that updated data??
medha123