From f1f4e8fe5f8a983c662ac9765860d7ed91790284 Mon Sep 17 00:00:00 2001 From: Xerol Wong Date: Sun, 5 Jan 2025 05:26:33 +0900 Subject: [PATCH] HEIF format name --- Sources/General/ImageSource/LivePhotoSource.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Sources/General/ImageSource/LivePhotoSource.swift b/Sources/General/ImageSource/LivePhotoSource.swift index 23a6c0fd7..eb3bda6df 100644 --- a/Sources/General/ImageSource/LivePhotoSource.swift +++ b/Sources/General/ImageSource/LivePhotoSource.swift @@ -63,10 +63,11 @@ public struct LivePhotoSource: Sendable { /// A resource type representing a component of a Live Photo, which consists of a still image and a video. /// -/// ``LivePhotoResource`` encapsulates the necessary information to download and cache a single components of a Live -/// Photo: it is either a still image (typically in HEIC format) or a video (typically in MOV format). Multiple -/// ``LivePhotoResource`` values (typically two, one for the image and one for the video) can form a ``LivePhotoSource``, -/// which is expected by Kingfisher in its live photo loading high level APIs. +/// ``LivePhotoResource`` encapsulates the necessary information to download and cache a single component of a Live +/// Photo: it is either a still image (typically in HEIF format with "heic" filename extension) or a video (typically in +/// QuickTime format with "mov" filename extension). Multiple ``LivePhotoResource`` values (typically two, one for the +/// image and one for the video) can form a ``LivePhotoSource``, which is expected by Kingfisher in its live photo +/// loading high level APIs. /// /// The Live Photo data can be retrieved by `PHAssetResourceManager.requestData` method and uploaded to your server. /// 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 { } static let fytpChunk: [UInt8] = [0x66, 0x74, 0x79, 0x70] // fytp (file type box) - static let heicChunk: [UInt8] = [0x68, 0x65, 0x69, 0x63] // .heic - static let qtChunk: [UInt8] = [0x71, 0x74, 0x20, 0x20] // quicktime, .mov + static let heicChunk: [UInt8] = [0x68, 0x65, 0x69, 0x63] // heic (HEIF) + static let qtChunk: [UInt8] = [0x71, 0x74, 0x20, 0x20] // qt (QuickTime), .mov static func guessedFileExtension(from data: Data) -> String? {