‘Pin Your Pics’ on the App Store

My new app is now live. It’s a utility for reviewing the GPS data in your Camera Roll: it steps through your pictures and, for those images which have the location data set, you link through to see a thumbnail of the image on a map. Based on some early feedback, as well as the ability to scroll through your entire library, you can quickly scan to the latest pictures. I also have a feature which allows you to see multiple images on a single map [up to fifty at a time].

I’m pretty pleased to have gotten it out the front door and – while I am biased 🙂 – I think it’s a genuinely useful app and well worth the 69p asking price.

The app icon is based on a picture from our last holiday, where the idea for the app started to foment. The image links through to the App Store:

Pin Your Pics

Thanks to Jen [imaginative name – and the actual pin in the macro shot of the map!], James [great feedback] and Sarah [persevering :)].

Doing Battle with imagePickerController and Orientation

I am in the home straight – hopefully – with my new app which is, unsurprisingly enough, photography related. It’s an order of magnitude of complexity above the weight tracker, and has been a real challenge to get through.

The interface to the  ALAssetsLibrary isn’t without its foibles, including the fact that, when used in conjunction with the image picker, there is a fair amount of work to be done by hand.

One of the bigger surprises is image orientation, which you have to add yourself.

Perhaps this incantation may come in handy for you:

UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
int imOrNum = image.imageOrientation;
...
int orientMetaVal = 0;
    if (imOrNum == 1)
    {
    // landscape, vol buttons up
        orientMetaVal = 3;
        landscapeSnap = TRUE;
    }
    else if (imOrNum == 3)
        //portrait, home button down
        orientMetaVal = 6;
    else if (imOrNum ==0)
    {
        // landscape, vol buttons down
        orientMetaVal = 0;
        landscapeSnap = TRUE;
    }
    else if (imOrNum == 2)
    {
        // portrait, home button up
        // 5 is weird - thumbnail right, image inverted.
        orientMetaVal = 8;
    }
...
[tmpMetadataDic setObject:[NSNumber numberWithInt:orientMetaVal] forKey:@"Orientation"];
So the landscape trueness is just something that I use when I’m previewing the image that has just been taken. You then need to set various bits and pieces in a NSMutableDictionary, such as the orientation, which eventually gets written back with the file as a parameter to
[yourInstantiatedAl writeImageToSavedPhotosAlbum:[nicePicture CGImage]
                            metadata:tmpMetadataDic

One other thing to look out for is the requirement to add in all of the vanilla EXIF data – ISO, shutter, etc. That’s actually pretty easy. I initialise the dictionary of metadata with this:

NSMutableDictionary *tmpMetadataDic = [info objectForKey:UIImagePickerControllerMediaMetadata];