Reading & writing Exif data with Cocoa
Reading & writing Exif data with Cocoa
- Subject: Reading & writing Exif data with Cocoa
- From: fp12 <email@hidden>
- Date: Tue, 05 Jul 2005 16:21:48 +0200
Hello,
I'm currently working on an application that needs to write EXIF (and
moreover GPS) data in a jpeg file.
I use NSBitmapImageRep, but I think there's something wrong with it,
because it doesn't even work for reading : |NSImageEXIFData| does NOT
contain any GPS information.
So, is it possible to get/set GPS info with the Cocoa API ? Am I in the
wrong way to make it ?
Here is a sample code showing that GPS information is not included in
EXIF Data :
#import <Cocoa/Cocoa.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString * fileName = @"imageTest.jpg" ;
NSFileManager * fileManager = [NSFileManager defaultManager] ;
if ([fileManager fileExistsAtPath:fileName])
{
NSBitmapImageRep * imageTest = [NSBitmapImageRep
imageRepWithContentsOfFile:fileName] ;
NSLog(@"Exif Data in %@ : %@",fileName, [imageTest
valueForProperty:@"NSImageEXIFData"]) ;
}
else
NSLog(@"File %@ not found !",fileName) ;
[pool release];
return 0;
}
Just use an image with GPS Data or download binary at
http://fp12.free.fr/StageMIS/NSImageTest.zip
Thanks you !
Bye,
Fabien Poupineau.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden