• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reading & writing Exif data with Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Reading & writing Exif data with Cocoa
      • From: Ken Ferry <email@hidden>
  • Prev by Date: Small UI question: toolbars
  • Next by Date: Re: iMovie-like sliding ready for drag
  • Previous by thread: Small UI question: toolbars
  • Next by thread: Re: Reading & writing Exif data with Cocoa
  • Index(es):
    • Date
    • Thread