Skip to content

Latest commit

 

History

History
96 lines (78 loc) · 2.85 KB

README.md

File metadata and controls

96 lines (78 loc) · 2.85 KB

qt-heif-image-plugin: Qt plugin for HEIF images

This is a Qt image plugin for HEIF images, wrapping libheif. It enables existing Qt applications to open and save .heic files, such as those from Apple devices.

Currently, support is limited to the following:

  • Basic reading and writing of the primary image
  • Reading of files with multiple top-level images

Note: This plugin is currently in progress for inclusion in qtimageformats. Please see the Qt Gerrit page or bug report for updates. Contributions should be made there, if possible. I will try to keep this repository up to date.

Installation

Ubuntu

A PPA exists for Ubuntu users. For xenial and earlier, the libheif repository must also be enabled for dependencies.

$ sudo add-apt-repository ppa:jakar/qt-heif
$ sudo apt update
$ sudo apt install qt-heif-image-plugin

Debian

Packages built against buster and unstable are provided on the latest release page.

Fedora

Package is available in the RPM Fusion free repository. To install it you need to enable RPM Fusion repo first - see Enable RPM Fusion on your system. Then it can be installed with following command:

$ sudo dnf install qt-heif-image-plugin

Other systems

Users of other systems should build from source.

Building from source

Dependencies

Runtime dependencies:

  • Qt 5 (Core and GUI modules)
  • libheif (≥ version 1.1)

Build-only dependencies:

  • cmake
  • pkg-config

Build instructions

Get the source code:

$ git clone https://github.com/jakar/qt-heif-image-plugin.git
$ cd qt-heif-image-plugin

Configure with cmake and compile:

$ mkdir build
$ cd build
$ cmake ..
$ make

Finally, install:

$ sudo make install

The built library will be installed to $QTDIR/plugins/imageformats. Beware that CMAKE_INSTALL_PREFIX will not be honored. Qt only searches in select directories for plugins.

Alternatively, to use with a specific application, place the plugin in $APPDIR/imageformats, where $APPDIR is the directory containing the application's binary.

Usage

Any application that (directly or indirectly) uses QImageReader to open image files should automatically be able to use this plugin.

This has been successfully used with the following:

To test the plugin, Dumageview was created.