Commit ba149f17 authored by Michael Natterer's avatar Michael Natterer 😴

plug-ins: add HEIF loading/saving plug-in written by Dirk Farin

Thanks a lot to Dirk for contributing this, added him to AUTHORS.

Import the code from https://github.com/strukturag/heif-gimp-plugin.git
as of today. Merged the files into a single-file plug-in. Changed
the code a lot to match our coding style, but only formatting,
no logic changes.

Still uses deprecated GimpDrawable API and no GIO, but I wanted to do
actual code changes separately from the initial import. Also disabled
metadata support because updating that to GimpMetadata was too much
for the initial import.
parent 07c81abf
...@@ -76,6 +76,7 @@ The following people have contributed code to GIMP: ...@@ -76,6 +76,7 @@ The following people have contributed code to GIMP:
Ell Ell
Morton Eriksen Morton Eriksen
Larry Ewing Larry Ewing
Dirk Farin
Pedro Alonso Ferrer Pedro Alonso Ferrer
Nick Fetchak Nick Fetchak
Piotr Filiciak Piotr Filiciak
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
<contributor role="author" last-active="2.0">Morton Eriksen</contributor> <contributor role="author" last-active="2.0">Morton Eriksen</contributor>
<contributor role="author" last-active="2.0">Larry Ewing</contributor> <contributor role="author" last-active="2.0">Larry Ewing</contributor>
<contributor role="documenter" last-active="2.6">Alessandro Falappa</contributor> <contributor role="documenter" last-active="2.6">Alessandro Falappa</contributor>
<contributor role="author" last-active="2.10">Dirk Farin</contributor>
<contributor role="author" last-active="2.4">Pedro Alonso Ferrer</contributor> <contributor role="author" last-active="2.4">Pedro Alonso Ferrer</contributor>
<contributor role="author" last-active="1.2">Nick Fetchak</contributor> <contributor role="author" last-active="1.2">Nick Fetchak</contributor>
<contributor role="author" last-active="2.4">Piotr Filiciak</contributor> <contributor role="author" last-active="2.4">Piotr Filiciak</contributor>
......
...@@ -81,6 +81,7 @@ m4_define([intltool_required_version], [0.40.1]) ...@@ -81,6 +81,7 @@ m4_define([intltool_required_version], [0.40.1])
m4_define([perl_required_version], [5.10.0]) m4_define([perl_required_version], [5.10.0])
m4_define([python2_required_version], [2.5.0]) m4_define([python2_required_version], [2.5.0])
m4_define([webp_required_version], [0.6.0]) m4_define([webp_required_version], [0.6.0])
m4_define([libheif_required_version], [1.1.0])
# Current test considers only 2 version numbers. If we update the recommended # Current test considers only 2 version numbers. If we update the recommended
# version of gettext with more version numbers, please update the tests. # version of gettext with more version numbers, please update the tests.
...@@ -167,6 +168,7 @@ INTLTOOL_REQUIRED_VERSION=intltool_required_version ...@@ -167,6 +168,7 @@ INTLTOOL_REQUIRED_VERSION=intltool_required_version
PERL_REQUIRED_VERSION=perl_required_version PERL_REQUIRED_VERSION=perl_required_version
PYTHON2_REQUIRED_VERSION=python2_required_version PYTHON2_REQUIRED_VERSION=python2_required_version
WEBP_REQUIRED_VERSION=webp_required_version WEBP_REQUIRED_VERSION=webp_required_version
LIBHEIF_REQUIRED_VERSION=libheif_required_version
XGETTEXT_RECOMMENDED_VERSION=xgettext_recommended_version XGETTEXT_RECOMMENDED_VERSION=xgettext_recommended_version
AC_SUBST(GLIB_REQUIRED_VERSION) AC_SUBST(GLIB_REQUIRED_VERSION)
AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION) AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
...@@ -197,6 +199,7 @@ AC_SUBST(INTLTOOL_REQUIRED_VERSION) ...@@ -197,6 +199,7 @@ AC_SUBST(INTLTOOL_REQUIRED_VERSION)
AC_SUBST(PERL_REQUIRED_VERSION) AC_SUBST(PERL_REQUIRED_VERSION)
AC_SUBST(PYTHON2_REQUIRED_VERSION) AC_SUBST(PYTHON2_REQUIRED_VERSION)
AC_SUBST(WEBP_REQUIRED_VERSION) AC_SUBST(WEBP_REQUIRED_VERSION)
AC_SUBST(LIBHEIF_REQUIRED_VERSION)
AC_SUBST(XGETTEXT_RECOMMENDED_VERSION) AC_SUBST(XGETTEXT_RECOMMENDED_VERSION)
# The symbol GIMP_UNSTABLE is defined above for substitution in # The symbol GIMP_UNSTABLE is defined above for substitution in
...@@ -1664,6 +1667,28 @@ fi ...@@ -1664,6 +1667,28 @@ fi
AM_CONDITIONAL(HAVE_WEBP, test "x$have_webp" = xyes) AM_CONDITIONAL(HAVE_WEBP, test "x$have_webp" = xyes)
###################
# Check for libheif
###################
AC_ARG_WITH(libheif, [ --without-libheif build without libheif support])
have_libheif=no
if test "x$with_libheif" != xno; then
have_libheif=yes
PKG_CHECK_MODULES(LIBHEIF, libheif >= libheif_required_version,
FILE_HEIF='file-heif$(EXEEXT)',
[have_libheif="no (libheif not found)"])
fi
if test "x$have_libheif" = xyes; then
MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
fi
AC_SUBST(FILE_HEIF)
AM_CONDITIONAL(HAVE_LIBHEIF, test "x$have_libheif" = xyes)
###################### ######################
# Check for libmypaint # Check for libmypaint
###################### ######################
...@@ -2762,6 +2787,7 @@ Optional Plug-Ins: ...@@ -2762,6 +2787,7 @@ Optional Plug-Ins:
MNG: $have_libmng MNG: $have_libmng
OpenEXR: $have_openexr OpenEXR: $have_openexr
WebP: $have_webp WebP: $have_webp
Heif: $have_libheif
PDF (export): $have_cairo_pdf PDF (export): $have_cairo_pdf
Print: $enable_print Print: $enable_print
Python 2: $enable_python Python 2: $enable_python
......
...@@ -78,6 +78,8 @@ ...@@ -78,6 +78,8 @@
/file-glob.exe /file-glob.exe
/file-header /file-header
/file-header.exe /file-header.exe
/file-heif
/file-heif.exe
/file-html-table /file-html-table
/file-html-table.exe /file-html-table.exe
/file-jp2-load /file-jp2-load
......
...@@ -87,6 +87,7 @@ libexec_PROGRAMS = \ ...@@ -87,6 +87,7 @@ libexec_PROGRAMS = \
file-gih \ file-gih \
file-glob \ file-glob \
file-header \ file-header \
$(FILE_HEIF) \
file-html-table \ file-html-table \
$(FILE_JP2_LOAD) \ $(FILE_JP2_LOAD) \
$(FILE_MNG) \ $(FILE_MNG) \
...@@ -144,6 +145,7 @@ libexec_PROGRAMS = \ ...@@ -144,6 +145,7 @@ libexec_PROGRAMS = \
EXTRA_PROGRAMS = \ EXTRA_PROGRAMS = \
file-aa \ file-aa \
file-heif \
file-jp2-load \ file-jp2-load \
file-mng \ file-mng \
file-pdf-save \ file-pdf-save \
...@@ -821,6 +823,27 @@ file_header_LDADD = \ ...@@ -821,6 +823,27 @@ file_header_LDADD = \
$(INTLLIBS) \ $(INTLLIBS) \
$(file_header_RC) $(file_header_RC)
file_heif_CFLAGS = $(LIBHEIF_CFLAGS)
file_heif_SOURCES = \
file-heif.c
file_heif_LDADD = \
$(libgimpui) \
$(libgimpwidgets) \
$(libgimpmodule) \
$(libgimp) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
$(GTK_LIBS) \
$(GEGL_LIBS) \
$(LIBHEIF_LIBS) \
$(RT_LIBS) \
$(INTLLIBS) \
$(file_heif_RC)
file_html_table_SOURCES = \ file_html_table_SOURCES = \
file-html-table.c file-html-table.c
......
This diff is collapsed.
...@@ -36,6 +36,7 @@ file_gif_save_RC = file-gif-save.rc.o ...@@ -36,6 +36,7 @@ file_gif_save_RC = file-gif-save.rc.o
file_gih_RC = file-gih.rc.o file_gih_RC = file-gih.rc.o
file_glob_RC = file-glob.rc.o file_glob_RC = file-glob.rc.o
file_header_RC = file-header.rc.o file_header_RC = file-header.rc.o
file_heif_RC = file-heif.rc.o
file_html_table_RC = file-html-table.rc.o file_html_table_RC = file-html-table.rc.o
file_jp2_load_RC = file-jp2-load.rc.o file_jp2_load_RC = file-jp2-load.rc.o
file_mng_RC = file-mng.rc.o file_mng_RC = file-mng.rc.o
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
'file-gih' => { ui => 1, gegl => 1 }, 'file-gih' => { ui => 1, gegl => 1 },
'file-glob' => {}, 'file-glob' => {},
'file-header' => { ui => 1, gegl => 1 }, 'file-header' => { ui => 1, gegl => 1 },
'file-heif' => { ui => 1, optional => 1, gegl => 1, libs => 'LIBHEIF_LIBS', cflags => 'LIBHEIF_CFLAGS' },
'file-html-table' => { ui => 1, gegl => 1 }, 'file-html-table' => { ui => 1, gegl => 1 },
'file-jp2-load' => { ui => 1, optional => 1, gegl => 1, libs => 'OPENJPEG_LIBS', cflags => 'OPENJPEG_CFLAGS' }, 'file-jp2-load' => { ui => 1, optional => 1, gegl => 1, libs => 'OPENJPEG_LIBS', cflags => 'OPENJPEG_CFLAGS' },
'file-mng' => { ui => 1, gegl => 1, optional => 1, libs => 'MNG_LIBS', cflags => 'MNG_CFLAGS' }, 'file-mng' => { ui => 1, gegl => 1, optional => 1, libs => 'MNG_LIBS', cflags => 'MNG_CFLAGS' },
......
...@@ -41,6 +41,7 @@ plug-ins/common/file-gif-save.c ...@@ -41,6 +41,7 @@ plug-ins/common/file-gif-save.c
plug-ins/common/file-gih.c plug-ins/common/file-gih.c
plug-ins/common/file-glob.c plug-ins/common/file-glob.c
plug-ins/common/file-header.c plug-ins/common/file-header.c
plug-ins/common/file-heif.c
plug-ins/common/file-html-table.c plug-ins/common/file-html-table.c
plug-ins/common/file-jp2-load.c plug-ins/common/file-jp2-load.c
plug-ins/common/file-mng.c plug-ins/common/file-mng.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment