开发者

In iphone-exif how to see updated image metadata info?

开发者 https://www.devze.com 2023-01-11 22:14 出处:网络
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 wa

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: imageD开发者_开发知识库ata];

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];


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];
0

精彩评论

暂无评论...
验证码 换一张
取 消