+- (void)startPhoto:(id<SaxAttributes>)_attrs {
+ [self startValueTag:@"photo" attributes:_attrs];
+ [self startCollectingContent];
+}
+- (void)endPhoto {
+ NSString *d;
+ NSData *photo;
+ unsigned count, i;
+
+ d = [self finishCollectingContent];
+ // TODO: rfc2426 requires support for URI and other stuff!
+ photo = [d dataByDecodingBase64];
+ [self->vCard setPhoto:photo];
+ count = [self->types count];
+ for (i = 0; i < count; i++) {
+ NSString *type = [self->types objectAtIndex:i];
+ if ([type isEqualToString:@"BASE64"]) {
+ continue;
+ }
+ else {
+ [self->vCard setPhotoType:type];
+ break;
+ }
+ }
+
+ [self endValueTag];
+}
+