objective c - How to set metadata for kCGImagePropertyRawDictionary on iOS? -
hi trying set custom information in image. documentation here: https://developer.apple.com/reference/imageio/kcgimagepropertyrawdictionary says dictionary minimal data.
what understand can store string or nsdata inside image.
ios not allow setting metadata not listed in cgimageproperties. not find possible keys under kcgimagepropertyrawdictionary. tried setting string directly. have failed.
does know how set value of kcgimagepropertyrawdictionary?
what understand can store string or nsdata inside image.
yes, purpose of image metadata store, well, image metadata. can include numbers, booleans, , – most commonly – strings. however, metadata system isn't designed arbitrary metadata – each value has specific purpose. enforce purpose, cgimagedestinationaddimage silently drops values believes invalid. there fixed set of keys allowable in properties dictionary passed function, union of destination properties , cgimageproperties.
you have correctly noted kcgimagepropertyrawdictionary 1 such allowable key. however, value must dictionary, , documentation not specify keys acceptable there – if did, listed on cgimageproperties page "raw dictionary keys." therefore, there no allowable keys dict. if want store data image doesn't fit 1 of (many) categories described in cgimageproperties, you'll have store elsewhere.
just fun, since curious, ran strings on imageio framework, , found list of ~300 string constants looked possible keys dict. wrote quick test program try put each 1 of keys dict @ kcgimagepropertyrawdictionary key. not single 1 made through. makes me think kcgimagepropertyrawdictionary there future use, , not accept metadata.
Comments
Post a Comment