Skip to content

Commit 8769e7c

Browse files
authored
Merge pull request onevcat#2344 from iXerol/fix/heif
Improve the description of the Live Photo file format
2 parents f4befce + f1f4e8f commit 8769e7c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Sources/General/ImageSource/LivePhotoSource.swift

+7-6
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ public struct LivePhotoSource: Sendable {
6363

6464
/// A resource type representing a component of a Live Photo, which consists of a still image and a video.
6565
///
66-
/// ``LivePhotoResource`` encapsulates the necessary information to download and cache a single components of a Live
67-
/// Photo: it is either a still image (typically in HEIC format) or a video (typically in MOV format). Multiple
68-
/// ``LivePhotoResource`` values (typically two, one for the image and one for the video) can form a ``LivePhotoSource``,
69-
/// which is expected by Kingfisher in its live photo loading high level APIs.
66+
/// ``LivePhotoResource`` encapsulates the necessary information to download and cache a single component of a Live
67+
/// Photo: it is either a still image (typically in HEIF format with "heic" filename extension) or a video (typically in
68+
/// QuickTime format with "mov" filename extension). Multiple ``LivePhotoResource`` values (typically two, one for the
69+
/// image and one for the video) can form a ``LivePhotoSource``, which is expected by Kingfisher in its live photo
70+
/// loading high level APIs.
7071
///
7172
/// The Live Photo data can be retrieved by `PHAssetResourceManager.requestData` method and uploaded to your server.
7273
/// You should not modify the metadata or other information of the data, otherwise, it is possible that the
@@ -167,8 +168,8 @@ extension LivePhotoResource.FileType {
167168
}
168169

169170
static let fytpChunk: [UInt8] = [0x66, 0x74, 0x79, 0x70] // fytp (file type box)
170-
static let heicChunk: [UInt8] = [0x68, 0x65, 0x69, 0x63] // .heic
171-
static let qtChunk: [UInt8] = [0x71, 0x74, 0x20, 0x20] // quicktime, .mov
171+
static let heicChunk: [UInt8] = [0x68, 0x65, 0x69, 0x63] // heic (HEIF)
172+
static let qtChunk: [UInt8] = [0x71, 0x74, 0x20, 0x20] // qt (QuickTime), .mov
172173

173174
static func guessedFileExtension(from data: Data) -> String? {
174175

0 commit comments

Comments
 (0)