0

I have noticed that, for images, the dictionary ALAssetRepresentation.metadata contains a couple of keys named "PixelHeight" and "PixelWidth". My question is: is there a guarantee that these keys will be present for all the images? As far as I can see, all the metadatas from the default representation of my images contain those keys, however I have not found a place in the documention where it is stated, so I'm a bit worried about letting my App think that those values will be always available.

Can anyone confirm or deny this?

Thanks a lot and best regards.

flainez
  • 11,797
  • 1
  • 18
  • 16

1 Answers1

3

It usually should be present. However, the more safe route is to use the dimensions of ALAssetRepresentation that was introduced in iOS 5.1

holtmann
  • 6,043
  • 32
  • 44
  • Thanks for the tip. This was really valuable. – Z S Jul 22 '12 at 00:27
  • @holtmann That's very nice, although I was looking at targeting iOS 5.0. Anyway, it is not a big deal and I think I can raise the target to 5.1. However, I find strange that the `dimensions` property or method is not listed in the official [documentation](http://developer.apple.com/library/ios/#DOCUMENTATION/AssetsLibrary/Reference/ALAssetRepresentation_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009728). Any idea on that? – flainez Jul 23 '12 at 13:20
  • Its in the header files. I guess they didn't bother to update the documentation:) – holtmann Jul 23 '12 at 16:03