Apple Live Photo文件格式 [英] Apple Live Photo file format

查看:871
本文介绍了Apple Live Photo文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple将在iOS 9/iPhone 6s中引入实时照片.文件格式在哪里记录?

Apple will introduce Live Photo in iOS 9/iPhone 6s. Where is the file format documented?

推荐答案

这是

Here's the link. Otherwise, here's the text:

实时照片

Live Photos是iOS 9的一项新功能,允许用户捕获和拍摄 通过比传统更丰富的环境重温他们最喜欢的时刻 相片.当用户按下快门按钮时,相机"应用 捕获更多内容以及常规照片,包括 照片前后的音频和其他帧.浏览时 通过这些照片,用户可以与他们互动并播放所有照片 捕获的内容,使照片栩栩如生.

Live Photos is a new feature of iOS 9 that allows users to capture and relive their favorite moments with richer context than traditional photos. When the user presses the shutter button, the Camera app captures much more content along with the regular photo, including audio and additional frames before and after the photo. When browsing through these photos, users can interact with them and play back all the captured content, making the photos come to life.

iOS 9.1引入了API,这些API允许应用程序结合播放 实时照片,以及导出数据以进行共享.有新的 Photos框架中的支持,以从中获取PHLivePhoto对象. PHImageManager对象,用于表示所有 包含一个实时照片.您可以使用PHLivePhotoView对象(已定义 (在PhotosUI框架中)以显示实时照片的内容. PHLivePhotoView视图负责显示图像,处理 所有用户交互,并应用视觉处理进行播放 内容.

iOS 9.1 introduces APIs that allow apps to incorporate playback of Live Photos, as well as export the data for sharing. There is new support in the Photos framework to fetch a PHLivePhoto object from the PHImageManager object, which is used to represent all the data that comprises a Live Photo. You can use a PHLivePhotoView object (defined in the PhotosUI framework) to display the contents of a Live Photo. The PHLivePhotoView view takes care of displaying the image, handling all user interaction, and applying the visual treatments to play back the content.

您还可以使用PHAssetResource访问PHLivePhoto的数据 用于共享目的的对象.您可以请求PHLivePhoto对象用于 通过使用PHImageManager或用户照片库中的资产 UIImagePickerController.如果您有共享扩展程序,也可以 使用NSItemProvider获取PHLivePhoto对象.在接收方 您可以从一组共享中重新创建PHLivePhoto对象 发件人最初导出的文件.

You can also use PHAssetResource to access the data of a PHLivePhoto object for sharing purposes. You can request a PHLivePhoto object for an asset in the user’s photo library by using PHImageManager or UIImagePickerController. If you have a sharing extension, you can also get PHLivePhoto objects by using NSItemProvider. On the receiving side of a share, you can recreate a PHLivePhoto object from the set of files originally exported by the sender.

显示实时照片的准则

请务必记住,实时照片仍然是照片.如果您必须在其中显示实时照片 建议您在不支持PHLivePhotoView的环境中使用 您将其作为普通照片展示.

It’s important to remember that a Live Photo is still a photo. If you have to display a Live Photo in an environment that doesn’t support PHLivePhotoView, it’s recommended that you present it as a regular photo.

不要单独显示实时照片的多余帧和音频. 重要的是,实时照片的内容必须以 使用相同视觉处理和互动的一致方式 在所有应用中建模.

Don’t display the extra frames and audio of a Live Photo separately. It's important that the content of the Live Photo be presented in a consistent way that uses the same visual treatment and interaction model in all apps.

建议您通过放置照片将照片识别为实时照片 PHLivePhotoView类方法提供的徽章 livePhotoBadgeImageWithOptions:PHLivePhotoBadgeOptionsOverContent在 照片的左上角.

It’s recommended that you identify a photo as a Live Photo by placing the badge provided by the PHLivePhotoView class method livePhotoBadgeImageWithOptions:PHLivePhotoBadgeOptionsOverContent in the top-left corner of the photo.

请注意,不支持提供以下视觉效果: 用户在照片"应用中浏览照片时会体验到.

Note that there is no support for providing the visual effect that users experience as they swipe through photos in the Photos app.

实时照片共享指南

实时照片的数据为 导出为PHAssetResource对象中的一组文件.一套 将文件上传到服务器时,必须将它们作为一个单元保存. 当您在接收方使用这些文件重建PHLivePhoto时, 文件已验证;如果文件不是来自加载失败 相同的资产.

The data of a Live Photo is exported as a set of files in a PHAssetResource object. The set of files must be preserved as a unit when you upload them to a server. When you rebuild a PHLivePhoto with these files on the receiver side, the files are validated; loading fails if the files don’t come from the same asset.

如果您的应用允许用户先对照片应用效果或调整, 共享它,请确保对所有帧进行相同的调整 实时照片.或者,如果您不支持调整整个 实时照片的内容,将其作为普通照片共享并显示 给用户的适当指示.

If your app lets users apply effects or adjustments to a photo before sharing it, be sure to apply the same adjustments to all frames of the Live Photo. Alternatively, if you don’t support adjusting the entire contents of a Live Photo, share it as a regular photo and show an appropriate indication to the user.

如果您的应用具有用于选择要共享的照片的UI,则应允许用户 播放全部内容,以便他们确切地知道它们是什么 共享.选择要在您的应用中共享的照片时,用户还应该 能够关闭实时照片,因此他们可以将其发布为传统照片 照片.

If your app has UI for picking photos to share, you should let users play back the entire contents so they know exactly what they are sharing.When selecting photos to share in your app, users should also be able to turn a Live Photo off, so they can post it as a traditional photo.

这篇关于Apple Live Photo文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆