function flickr_photos_import_photo($photo, $more = array())
{
    log_info("get ready to import a photo...");
    $user = flickr_users_ensure_user_account($photo['owner'], $photo['ownername']);
    if (!$user || !$user['id']) {
        return not_okay("failed to retrieve user (photo owner)");
    }
    $photo = _flickr_photos_import_prepare_photo($user, $photo);
    # log_info("photo..." . var_export($photo, 1));
    # TO DO: error handling...
    if ($_photo = flickr_photos_get_by_id($photo['id'])) {
        log_info("update photo {$photo['id']}");
        # TO DO: make this less stupid...
        unset($photo['id']);
        flickr_photos_update_photo($_photo, $photo);
        $photo = flickr_photos_get_by_id($_photo['id']);
    } else {
        log_info("add photo {$photo['id']}");
        $rsp = flickr_photos_add_photo($photo);
        if (!$rsp['ok']) {
            log_info("FAILED to add photo {$photo['id']} :" . var_export($rsp, 1));
            return $rsp;
        }
        flickr_photos_lookup_add($photo['id'], $photo['user_id']);
    }
    flickr_photos_import_photo_files($photo, $more);
    # exif data
    # why did I do this? (20111206/straup)
    # $more = array(
    # 	'force' => 1,
    # );
    if ($hasexif = flickr_photos_exif_has_exif($photo, $more)) {
        $update = array('hasexif' => 1);
        $rsp = flickr_photos_update_photo($photo, $update);
        # technically we'll have the old last_update date
        # but that shouldn't be a problem (20111121/straup)
        if ($rsp['ok']) {
            $photo = array_merge($photo, $update);
        }
    }
    # things that depend on solr (move to a separate function?)
    if ($GLOBALS['cfg']['enable_feature_solr']) {
        flickr_photos_search_index_photo($photo);
    }
    if ($GLOBALS['cfg']['enable_feature_solr'] && $GLOBALS['cfg']['enable_feature_places']) {
        if ($photo['woeid'] && $GLOBALS['cfg']['places_prefetch_data']) {
            flickr_places_get_by_woeid($photo['woeid']);
        }
    }
    # go!
    return okay(array('photo' => $photo));
}
function check_photo($row, $more = array())
{
    $photo = flickr_photos_get_by_id($row['id']);
    $more = array('force' => 1);
    $hasexif = flickr_photos_exif_has_exif($photo, $more);
    # echo "photo {$photo['id']} has exif: {$hasexif}\n";
    if ($hasexif) {
        $update = array('hasexif' => 1);
        $rsp = flickr_photos_update_photo($photo, $update);
        if (!$rsp['ok']) {
            echo "ack! failed to update {$photo['id']}: {$rsp['error']}\n";
        }
    }
}