Permalink
Browse files

Handle photo library also in simulator and fixed a potential crash in…

… exif library while in release mode. Credit to Michael Krause for the patch.
  • Loading branch information...
nst committed Dec 15, 2009
1 parent ce9a9d2 commit 9a39967207dcf540c82e8ee40df874380932afde
Showing with 558 additions and 83 deletions.
  1. +3 −1 Classes/EXFMetaData.m
  2. +9 −3 Classes/SPSourcePhotosTVC.m
  3. +516 −48 SpyPhone.xcodeproj/nst.pbxuser
  4. +30 −31 SpyPhone.xcodeproj/nst.perspectivev3
View
@@ -1264,7 +1264,9 @@ -(void) parseExif: (CFDataRef*) exifData
// get the endian of the bytes
UInt8 order[2];
- CFDataGetBytes(*exifData, CFRangeMake(6,8), order);
+ //CFDataGetBytes(*exifData, CFRangeMake(6,8), order);
+ CFDataGetBytes(*exifData, CFRangeMake(6,2), order);
+
if (M_ORDER == order[0] && M_ORDER == order[1]){
self.bigEndianOrder =YES;
@@ -29,10 +29,16 @@ - (void)mapButtonClicked:(id)sender {
- (NSArray *)jpgPaths {
NSMutableArray *a = [NSMutableArray array];
- NSString *path = @"/var/mobile/Media/DCIM";
+// NSString *path = @"/var/mobile/Media/DCIM";
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths count] ? [paths objectAtIndex:0] : nil;
+ NSString *path = [documentsDirectory stringByAppendingPathComponent:@"../../../Media/DCIM"];
+ path = [path stringByStandardizingPath];
+
NSDirectoryEnumerator *dirEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:path];
-
+
BOOL isDir;
+
BOOL exists;
NSString *filePath = nil;
@@ -58,7 +64,7 @@ - (void)loadData {
self.annotations = [NSMutableArray array];
- NSEnumerator *e = [[[self jpgPaths] reverseObjectEnumerator] init];
+ NSEnumerator *e = [[self jpgPaths] reverseObjectEnumerator];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *s = nil;
Oops, something went wrong.

0 comments on commit 9a39967

Please sign in to comment.