开发者

Loss of image metadata

I am transferring images from a Mac desktop application to an iPad application, but along the way I lose all the image's EXIF data.

The setup is as follows:

On the Mac: 1 - grab NSData from image 2 - resize image 3 - send image to iPad application over wireless network

On the iPad: 4 - write NSData to file 5 - read image from file

Once the NSData gets on the iPad, the EXIF data seems to be lost. If I manually open the image, there is no EXIF data to be found.

Do you have any idea why the EXIF data gets lost? The resize operation does not affect the EXIF data (I have checked that), but once the NSData arrives on the iPad, I don't have any EXIF data left (even before I write the data to disk). I would think that the data I send from the Ma开发者_开发知识库c to the iPad is identical.

I use the ImageIO framework to access the data on both platforms. Is it possible that ImageIO on the iPad/iPhone does things differently and strips away or does not support EXIF data?

Any pointers are welcome.


I use the ImageIO framework to access the data on both platforms. Is it possible that ImageIO on the iPad/iPhone does things differently and strips away or does not support EXIF data?

Yes, that is possible, but unlikely.

More likely is that you're not supporting EXIF data.

A CGImage object is just an image; if you only extract the CGImage(s) from the file, then you are only getting images, not EXIF or other property (e.g., resolution, color-space) data. You need to get, transfer, and apply the properties dictionaries along with the images.

It seems to me that it would be easier to do this all on the Mac and simply send the final image to the iPad. In the case of resizing downward, this would even make it faster, since you would be transferring less data (a smaller image).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜