Edited metadata is not available in iCloud Photo Library

Originator:craig.hockenberry
Number:rdar://27333690 Date Originated:13-Jul-2016 03:17 PM
Status:Open Resolved:
Product:iOS SDK Product Version:10.0 (14A5297c)
Classification:Serious Bug Reproducible:Always
 
Summary:

Edited metadata is not available to apps that are using the iCloud Photo Library. This includes Apple’s Photos apps on macOS and iOS.

Customers who create titles, descriptions, and keywords using Photos on the Mac cannot view the IPTC metadata on iOS. Likewise, customers who use a Photos editing extension on iOS to add new metadata to a FullSizeRender.jpg won’t see that information on macOS when they view the image in Photos.

This presents a confusing situation for the customer: when they add a watermark (with their copyright) and update the kCGImagePropertyTIFFCopyright property in the image metadata, only one of those changes will appear in the iCloud Photo Library. It’s not clear how or why this is happening since they know that metadata is a part of the image file format.

Steps to Reproduce:

1) Using the Photos app on the Mac, edit the title, description, and keywords for an image.
2) On iOS, download the current version of the image using this code:

    PHAsset *asset = ...;

    PHImageRequestOptions *options = [PHImageRequestOptions new];
    options.networkAccessAllowed = YES;
    options.version = PHImageRequestOptionsVersionCurrent;
    options.resizeMode = PHImageRequestOptionsResizeModeNone;
    options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat; // ignored by requestImageDataForAsset

    self.requestID = [self.imageManager requestImageDataForAsset:asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
        if (imageData) {
            NSDictionary *metadata = nil;

            CGImageSourceRef sourceRef = CGImageSourceCreateWithData((CFDataRef)self, NULL);
            if (sourceRef) {
                CFDictionaryRef dictionaryRef = CGImageSourceCopyPropertiesAtIndex(sourceRef, 0, NULL);
                if (dictionaryRef) {
                    metadata = (__bridge NSDictionary *)dictionaryRef;
                    CFRelease (dictionaryRef);
                }
                CFRelease (sourceRef);
            }

            NSLog("metadata = %@", metadata);

            self.requestID = PHInvalidAssetResourceDataRequestID;
        }
    }];

Expected Results:

The metadata variable should contain some IPTC data.

Actual Results:

The metadata returned is from the original file, not the edit.

Regression:

N/A

Notes:

The header documentation for -requestImageDataForAsset:options:resultHandler states that PHImageRequestOptionsVersionCurrent can be used to retrieve the adjusted rendered image but this doesn't seem to apply to adjustments to the metadata.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!