{"id":28559046,"url":"https://github.com/sdwebimage/libheif-xcode","last_synced_at":"2025-06-10T08:35:59.173Z","repository":{"id":36806644,"uuid":"162795100","full_name":"SDWebImage/libheif-Xcode","owner":"SDWebImage","description":"A wrapper for libheif + Xcode project. Support Carthage \u0026\u0026 CocoaPods \u0026\u0026 SwiftPM.","archived":false,"fork":false,"pushed_at":"2024-08-12T11:02:35.000Z","size":578,"stargazers_count":12,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-04T03:26:17.277Z","etag":null,"topics":["carthage","heif","hevc","ios","macos","swiftpm","tvos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SDWebImage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-22T08:34:25.000Z","updated_at":"2025-03-20T20:46:29.000Z","dependencies_parsed_at":"2024-11-06T14:36:26.667Z","dependency_job_id":null,"html_url":"https://github.com/SDWebImage/libheif-Xcode","commit_stats":{"total_commits":73,"total_committers":1,"mean_commits":73.0,"dds":0.0,"last_synced_commit":"29bbadaf0cccf1a62138377fda7da5954d0f73ae"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2Flibheif-Xcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2Flibheif-Xcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2Flibheif-Xcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2Flibheif-Xcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SDWebImage","download_url":"https://codeload.github.com/SDWebImage/libheif-Xcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2Flibheif-Xcode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039547,"owners_count":22796853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","heif","hevc","ios","macos","swiftpm","tvos","watchos"],"created_at":"2025-06-10T08:35:58.193Z","updated_at":"2025-06-10T08:35:59.129Z","avatar_url":"https://github.com/SDWebImage.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libheif + Xcode\n\n[![CI Status](http://img.shields.io/travis/SDWebImage/libheif-Xcode.svg?style=flat)](https://travis-ci.org/SDWebImage/libheif-Xcode)\n[![Version](https://img.shields.io/cocoapods/v/libheif.svg?style=flat)](http://cocoapods.org/pods/libheif)\n[![License](https://img.shields.io/cocoapods/l/libheif.svg?style=flat)](http://cocoapods.org/pods/libheif)\n[![Platform](https://img.shields.io/cocoapods/p/libheif.svg?style=flat)](http://cocoapods.org/pods/libheif)\n[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/libheif-Xcode)\n\nA wrapper for [libheif](https://github.com/strukturag/libheif) + Xcode project.\nThis enables Carthage support to build libheif as a framework for Apple's platform. \n\nThis repo also including the CocoaPods's spec file to use libheif.\n\n## Requirements\n\n+ iOS 9+\n+ macOS 10.11+\n+ tvOS 9+\n+ watchOS 2+\n\n## Installation\n\n### Carthage\n\nlibheif is (via this repo) available through [Carthage](https://github.com/Carthage/Carthage).\n\n```\ngithub \"SDWebImage/libheif-Xcode\"\n```\n\n### CocoaPods\n\nlibheif is available through [CocoaPods](https://github.com/CocoaPods/CocoaPods).\n\n```\npod 'libheif'\n```\n\n#### Swift Package Manager (Xcode 11+)\n\nlibheif is available through [Swift Package Manager](https://swift.org/package-manager).\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/SDWebImage/libheif-Xcode.git\", from: \"1.6.1\")\n    ]\n)\n```\n\n## HEIF Encoding\n\nlibheif itself is not a full function decoder but an abstract layer. It needs [libde265](http://www.libde265.org/) for HEIF decoder support, and [x265](http://x265.org/) for HEIF encoder support.\n\nNote: Since most of people's usage of this library is for HEIF decoding, and `x265` is under GPLv2 license, we only integrate libheif with [libde265-Xcode](https://github.com/SDWebImage/libde265-Xcode) on Carthage/SwiftPM package manager. If you want x265 with HEIF encoding support, read below carefully.\n\n### x265 on CocoaPods\n\nFor CocoaPods user, you can use `libx265` subspec to integrate the x265 codec supports for HEIF encoding.\n\n```ruby\npod 'libheif', :subspecs =\u003e ['libde265', 'libx265']\n```\n\n### x265 on Carthage\n\nFor Carthage user, export the environment (using bash profile or xcconfig if you want) `HAVE_X265=1`, and modify carthage's xcconfig about `GCC_PREPROCESSOR_DEFINITIONS` to build.\n\nYou can use the shell script to spawn carthage, like run via `carthage_build_with_x265.sh build`\n\n```bash\n#!/bin/bash -e\nxcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)\necho \"GCC_PREPROCESSOR_DEFINITIONS = $(inherited) HAVE_X265=1\" \u003e\u003e $xcconfig\n\nexport XCODE_XCCONFIG_FILE=\"$xcconfig\"\n\ncarthage \"$@\"\n```\n\n### x265 on SwiftPM\n\nFor SPM user, export the environment (using bash profile or xcconfig if you want) `HAVE_X265=1`, and use `xcodebuild` or `swift build` to build.\n\n```bash\nmv libheif.xcodeproj libheif.xcodeproj.bak\nHAVE_X265=1 xcodebuild build -scheme libheif -sdk macosx -destination \"generic/platform=macOS\"\n```\n\n## AVIF Decoding\n\n+ aom\n\nlibheif from v1.7.0 added the support for [AV1 Image File Format (AVIF)](https://aomediacodec.github.io/av1-avif). To keep the component functional, we only integrate the AVIF support in CocoaPods via `libaom` subspec.\n\n```ruby\npod 'libheif', :subspecs =\u003e ['libaom']\n```\n\n+ dav1d\n\nlibheif from v1.9.0 added the support to use [dav1d](https://code.videolan.org/videolan/dav1d) as AVIF decoder codec.\n\nTo use dav1d as decoder codec, use the subspec like this:\n\n```ruby\npod 'libheif', :subspecs =\u003e ['libdav1d']\n```\n\n\n## AVIF Encoding\n\n+ aom\n\nlibheif from v1.7.0 added the support to use `libaom` as the default AVIF encoder codec. However, libaom does not performent so well on most mobile system.\n\n```ruby\npod 'libheif', :subspecs =\u003e ['libaom']\n```\n\n+ rav1e\n\nThere is another AVIF encoder codec, [rav1e](https://github.com/xiph/rav1e). Which added from v1.8.0 version. For CocoaPods, you can choose to use via `librav1e` subspec.\n\n```ruby\npod 'libheif', :subspecs =\u003e ['librav1e']\n```\n\nNotes:\n\n1. rav1e supports iOS and macOS only, because Rust language does not supports tvOS or watchOS bitcode format.\n2. rav1e only supports AVIF encoding, for AVIF decoding, you can choose to use aom, or dav1d\n\n```ruby\npod 'libheif', :subspecs =\u003e ['libdav1d', 'librav1e']\n# or if you prefer aom\npod 'libheif', :subspecs =\u003e ['libaom', 'librav1e']\n```\n\n+ svt-av1\n\nlibheif from v1.14.0 added the support to use [svt-av1](https://gitlab.com/AOMediaCodec/SVT-AV1) as AVIF decoder and encoder codec.\n\nTo use svt-av1 as encoder and decoder codec, use the subspec like this:\n\n```ruby\npod 'libheif', :subspecs =\u003e ['svt-av1']\n```\n\n## License\n\nlibheif is available under the terms of the GNU Lesser General Public License. See [the LICENSE file](https://github.com/strukturag/libheif/blob/master/COPYING) for more info.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdwebimage%2Flibheif-xcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdwebimage%2Flibheif-xcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdwebimage%2Flibheif-xcode/lists"}