Merge branch 'add-heifload'

This commit is contained in:
John Cupitt 2019-02-17 17:11:14 +00:00
commit 1a83605238
17 changed files with 2823 additions and 12 deletions

View File

@ -23,6 +23,8 @@
- add XMP, IPCT, ICC, EXIF etc. support to magickload/magicksave
- much lower memuse for gifload
- tilecache speedups
- add vips_heifload(), vips_heifsave()
- add heif thumbnail support to vips_thumbnail()
4/1/19 started 8.7.4
- magickload with magick6 API did not chain exceptions correctly causing a

153
confdefs.h Normal file
View File

@ -0,0 +1,153 @@
/* confdefs.h */
#define PACKAGE_NAME "vips"
#define PACKAGE_TARNAME "vips"
#define PACKAGE_VERSION "8.8.0"
#define PACKAGE_STRING "vips 8.8.0"
#define PACKAGE_BUGREPORT "vipsip@jiscmail.ac.uk"
#define PACKAGE_URL ""
#define PACKAGE "vips"
#define VERSION "8.8.0"
#define G_LOG_DOMAIN "VIPS"
#define VIPS_ICC_DIR "/usr/share/color/icc"
#define VIPS_PREFIX "/home/john/vips"
#define VIPS_LIBDIR "/home/john/vips/lib"
#define GETTEXT_PACKAGE "vips8.8"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_LOCALE_H 1
#define HAVE_LC_MESSAGES 1
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
#define HAVE_GETTEXT 1
#define HAVE_DCGETTEXT 1
#define ENABLE_NLS 1
#define HAVE_DIRENT_H 1
#define STDC_HEADERS 1
#define HAVE_ERRNO_H 1
#define HAVE_MATH_H 1
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_FILE_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_MMAN_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define restrict __restrict
#define HAVE_VAR_ATTRIBUTE_VECTOR_SIZE 1
#define HAVE_VECTOR_SHUFFLE 1
#define HAVE_VECTOR_ARITH 1
#define HAVE_STDLIB_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_MMAP 1
#define HAVE_VPRINTF 1
#define HAVE_GETCWD 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETWD 1
#define HAVE_MEMSET 1
#define HAVE_MUNMAP 1
#define HAVE_PUTENV 1
#define HAVE_REALPATH 1
#define HAVE_STRCASECMP 1
#define HAVE_STRCHR 1
#define HAVE_STRCSPN 1
#define HAVE_STRDUP 1
#define HAVE_STRERROR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSPN 1
#define HAVE_VSNPRINTF 1
#define HAVE_REALPATH 1
#define HAVE_MKSTEMP 1
#define HAVE_MKTEMP 1
#define HAVE_RANDOM 1
#define HAVE_RAND 1
#define HAVE_SYSCONF 1
#define HAVE_ATEXIT 1
#define HAVE_CBRT 1
#define HAVE_HYPOT 1
#define HAVE_ATAN2 1
#define HAVE_CONTEXT_GET_HELP 1
#define HAVE_MONOTONIC_TIME 1
#define HAVE_MUTEX_INIT 1
#define HAVE_COND_INIT 1
#define HAVE_THREAD_NEW 1
#define HAVE_PRIVATE_INIT 1
#define HAVE_VALUE_GET_SCHAR 1
#define HAVE_G_STR_TO_ASCII 1
#define HAVE_CHECKED_MUL 1
#define HAVE_EXPAT_H 1
#define HAVE_GSF 1
#define HAVE_GSF_ZIP64 1
#define HAVE_GSF_DEFLATE_LEVEL 1
#define HAVE_FFTW 1
#define HAVE_MAGICK6 1
#define HAVE_SETIMAGEOPTION 1
#define HAVE_SETIMAGEOPTION 1
#define HAVE_MAGICKCOREGENESIS 1
#define HAVE_MAGICKCOREGENESIS 1
#define HAVE_RESETIMAGEPROPERTYITERATOR 1
#define HAVE_RESETIMAGEPROPERTYITERATOR 1
#define HAVE_RESETIMAGEATTRIBUTEITERATOR 1
#define HAVE_RESETIMAGEATTRIBUTEITERATOR 1
#define HAVE_RESETIMAGEPROFILEITERATOR 1
#define HAVE_RESETIMAGEPROFILEITERATOR 1
#define HAVE_GETVIRTUALPIXELS 1
#define HAVE_GETVIRTUALPIXELS 1
#define HAVE_NUMBER_SCENES 1
#define HAVE_ACQUIREIMAGE 1
#define HAVE_ACQUIREIMAGE 1
#define HAVE_SETIMAGEEXTENT 1
#define HAVE_SETIMAGEEXTENT 1
#define HAVE_SETIMAGEPROPERTY 1
#define HAVE_SETIMAGEPROPERTY 1
#define HAVE_BLOBTOSTRINGINFO 1
#define HAVE_BLOBTOSTRINGINFO 1
#define HAVE_INHERITEXCEPTION 1
#define HAVE_INHERITEXCEPTION 1
#define HAVE_ACQUIREEXCEPTIONINFO 1
#define HAVE_ACQUIREEXCEPTIONINFO 1
#define HAVE_IMPORTIMAGEPIXELS 1
#define HAVE_IMPORTIMAGEPIXELS 1
#define HAVE_IMAGESTOBLOB 1
#define HAVE_IMAGESTOBLOB 1
#define ENABLE_MAGICKLOAD 1
#define ENABLE_MAGICKSAVE 1
#define HAVE_ORC 1
#define HAVE_ORC_PROGRAM_GET_ERROR 1
#define HAVE_ORC_PROGRAM_GET_ERROR 1
#define HAVE_LCMS2 1
#define HAVE_OPENEXR 1
#define HAVE_NIFTI 1
#define HAVE_POPPLER 1
#define HAVE_RSVG 1
#define HAVE_ZLIB 1
#define HAVE_OPENSLIDE_3_4 1
#define HAVE_OPENSLIDE 1
#define HAVE_MATIO 1
#define HAVE_PPM 1
#define HAVE_ANALYZE 1
#define HAVE_RADIANCE 1
#define HAVE_CFITSIO 1
#define HAVE_LIBWEBP 1
#define HAVE_PANGOFT2 1
#define HAVE_TIFF 1
#define HAVE_GIFLIB 1
#define HAVE_PNG 1
#define HAVE_JPEG 1
#define HAVE_EXIF 1
#define UNTAGGED_EXIF 1

View File

@ -911,6 +911,22 @@ if test x"$with_nifti" != x"no"; then
)
fi
# libheif
AC_ARG_WITH([heif],
AS_HELP_STRING([--without-heif], [build without libheif (default: test)]))
if test x"$with_heif" != x"no"; then
PKG_CHECK_MODULES(HEIF, libheif,
[AC_DEFINE(HAVE_HEIF,1,[define if you have libheif installed.])
with_heif=yes
PACKAGES_USED="$PACKAGES_USED libheif"
],
[AC_MSG_WARN([libheif not found; disabling HEIF support])
with_heif=no
]
)
fi
# pdfium
AC_ARG_WITH([pdfium],
AS_HELP_STRING([--without-pdfium], [build without pdfium (default: test)]))
@ -1326,14 +1342,14 @@ fi
# Gather all up for VIPS_CFLAGS, VIPS_INCLUDES, VIPS_LIBS
# sort includes to get longer, more specific dirs first
# helps, for example, selecting graphicsmagick over imagemagick
VIPS_CFLAGS=`for i in $VIPS_CFLAGS $GTHREAD_CFLAGS $REQUIRED_CFLAGS $EXPAT_CFLAGS $ZLIB_CFLAGS $PANGOFT2_CFLAGS $GSF_CFLAGS $FFTW_CFLAGS $MAGICK_CFLAGS $JPEG_CFLAGS $PNG_CFLAGS $IMAGEQUANT_CFLAGS $EXIF_CFLAGS $MATIO_CFLAGS $CFITSIO_CFLAGS $LIBWEBP_CFLAGS $LIBWEBPMUX_CFLAGS $GIFLIB_INCLUDES $RSVG_CFLAGS $PDFIUM_INCLUDES $POPPLER_CFLAGS $OPENEXR_CFLAGS $OPENSLIDE_CFLAGS $ORC_CFLAGS $TIFF_CFLAGS $LCMS_CFLAGS
VIPS_CFLAGS=`for i in $VIPS_CFLAGS $GTHREAD_CFLAGS $REQUIRED_CFLAGS $EXPAT_CFLAGS $ZLIB_CFLAGS $PANGOFT2_CFLAGS $GSF_CFLAGS $FFTW_CFLAGS $MAGICK_CFLAGS $JPEG_CFLAGS $PNG_CFLAGS $IMAGEQUANT_CFLAGS $EXIF_CFLAGS $MATIO_CFLAGS $CFITSIO_CFLAGS $LIBWEBP_CFLAGS $LIBWEBPMUX_CFLAGS $GIFLIB_INCLUDES $RSVG_CFLAGS $PDFIUM_INCLUDES $POPPLER_CFLAGS $OPENEXR_CFLAGS $OPENSLIDE_CFLAGS $ORC_CFLAGS $TIFF_CFLAGS $LCMS_CFLAGS $HEIF_CFLAGS
do
echo $i
done | sort -ru`
VIPS_CFLAGS=`echo $VIPS_CFLAGS`
VIPS_CFLAGS="$VIPS_DEBUG_FLAGS $VIPS_CFLAGS"
VIPS_INCLUDES="$ZLIB_INCLUDES $PNG_INCLUDES $TIFF_INCLUDES $JPEG_INCLUDES $NIFTI_INCLUDES"
VIPS_LIBS="$ZLIB_LIBS $MAGICK_LIBS $PNG_LIBS $IMAGEQUANT_LIBS $TIFF_LIBS $JPEG_LIBS $GTHREAD_LIBS $REQUIRED_LIBS $EXPAT_LIBS $PANGOFT2_LIBS $GSF_LIBS $FFTW_LIBS $ORC_LIBS $LCMS_LIBS $GIFLIB_LIBS $RSVG_LIBS $NIFTI_LIBS $PDFIUM_LIBS $POPPLER_LIBS $OPENEXR_LIBS $OPENSLIDE_LIBS $CFITSIO_LIBS $LIBWEBP_LIBS $LIBWEBPMUX_LIBS $MATIO_LIBS $EXIF_LIBS -lm"
VIPS_LIBS="$ZLIB_LIBS $HEIF_LIBS $MAGICK_LIBS $PNG_LIBS $IMAGEQUANT_LIBS $TIFF_LIBS $JPEG_LIBS $GTHREAD_LIBS $REQUIRED_LIBS $EXPAT_LIBS $PANGOFT2_LIBS $GSF_LIBS $FFTW_LIBS $ORC_LIBS $LCMS_LIBS $GIFLIB_LIBS $RSVG_LIBS $NIFTI_LIBS $PDFIUM_LIBS $POPPLER_LIBS $OPENEXR_LIBS $OPENSLIDE_LIBS $CFITSIO_LIBS $LIBWEBP_LIBS $LIBWEBPMUX_LIBS $MATIO_LIBS $EXIF_LIBS -lm"
AC_SUBST(VIPS_LIBDIR)
@ -1426,6 +1442,7 @@ accelerate loops with orc: $with_orc
(requires orc-0.4.11 or later)
ICC profile support with lcms: $with_lcms
file import with niftiio: $with_nifti
file import with libheif: $with_heif
file import with OpenEXR: $with_OpenEXR
file import with OpenSlide: $with_openslide
(requires openslide-3.3.0 or later)

184
confrLMsNU/defines.awk Normal file
View File

@ -0,0 +1,184 @@
BEGIN {
D["PACKAGE_NAME"]=" \"vips\""
D["PACKAGE_TARNAME"]=" \"vips\""
D["PACKAGE_VERSION"]=" \"8.8.0\""
D["PACKAGE_STRING"]=" \"vips 8.8.0\""
D["PACKAGE_BUGREPORT"]=" \"vipsip@jiscmail.ac.uk\""
D["PACKAGE_URL"]=" \"\""
D["PACKAGE"]=" \"vips\""
D["VERSION"]=" \"8.8.0\""
D["G_LOG_DOMAIN"]=" \"VIPS\""
D["VIPS_ICC_DIR"]=" \"/usr/share/color/icc\""
D["VIPS_PREFIX"]=" \"/home/john/vips\""
D["VIPS_LIBDIR"]=" \"/home/john/vips/lib\""
D["GETTEXT_PACKAGE"]=" \"vips8.8\""
D["STDC_HEADERS"]=" 1"
D["HAVE_SYS_TYPES_H"]=" 1"
D["HAVE_SYS_STAT_H"]=" 1"
D["HAVE_STDLIB_H"]=" 1"
D["HAVE_STRING_H"]=" 1"
D["HAVE_MEMORY_H"]=" 1"
D["HAVE_STRINGS_H"]=" 1"
D["HAVE_INTTYPES_H"]=" 1"
D["HAVE_STDINT_H"]=" 1"
D["HAVE_UNISTD_H"]=" 1"
D["HAVE_LOCALE_H"]=" 1"
D["HAVE_LC_MESSAGES"]=" 1"
D["HAVE_BIND_TEXTDOMAIN_CODESET"]=" 1"
D["HAVE_GETTEXT"]=" 1"
D["HAVE_DCGETTEXT"]=" 1"
D["ENABLE_NLS"]=" 1"
D["HAVE_DIRENT_H"]=" 1"
D["STDC_HEADERS"]=" 1"
D["HAVE_ERRNO_H"]=" 1"
D["HAVE_MATH_H"]=" 1"
D["HAVE_FCNTL_H"]=" 1"
D["HAVE_LIMITS_H"]=" 1"
D["HAVE_STDLIB_H"]=" 1"
D["HAVE_STRING_H"]=" 1"
D["HAVE_SYS_FILE_H"]=" 1"
D["HAVE_SYS_IOCTL_H"]=" 1"
D["HAVE_SYS_PARAM_H"]=" 1"
D["HAVE_SYS_TIME_H"]=" 1"
D["HAVE_SYS_MMAN_H"]=" 1"
D["HAVE_SYS_TYPES_H"]=" 1"
D["HAVE_SYS_STAT_H"]=" 1"
D["HAVE_UNISTD_H"]=" 1"
D["HAVE_DLFCN_H"]=" 1"
D["LT_OBJDIR"]=" \".libs/\""
D["restrict"]=" __restrict"
D["HAVE_VAR_ATTRIBUTE_VECTOR_SIZE"]=" 1"
D["HAVE_VECTOR_SHUFFLE"]=" 1"
D["HAVE_VECTOR_ARITH"]=" 1"
D["HAVE_STDLIB_H"]=" 1"
D["HAVE_UNISTD_H"]=" 1"
D["HAVE_SYS_PARAM_H"]=" 1"
D["HAVE_GETPAGESIZE"]=" 1"
D["HAVE_MMAP"]=" 1"
D["HAVE_VPRINTF"]=" 1"
D["HAVE_GETCWD"]=" 1"
D["HAVE_GETTIMEOFDAY"]=" 1"
D["HAVE_GETWD"]=" 1"
D["HAVE_MEMSET"]=" 1"
D["HAVE_MUNMAP"]=" 1"
D["HAVE_PUTENV"]=" 1"
D["HAVE_REALPATH"]=" 1"
D["HAVE_STRCASECMP"]=" 1"
D["HAVE_STRCHR"]=" 1"
D["HAVE_STRCSPN"]=" 1"
D["HAVE_STRDUP"]=" 1"
D["HAVE_STRERROR"]=" 1"
D["HAVE_STRRCHR"]=" 1"
D["HAVE_STRSPN"]=" 1"
D["HAVE_VSNPRINTF"]=" 1"
D["HAVE_REALPATH"]=" 1"
D["HAVE_MKSTEMP"]=" 1"
D["HAVE_MKTEMP"]=" 1"
D["HAVE_RANDOM"]=" 1"
D["HAVE_RAND"]=" 1"
D["HAVE_SYSCONF"]=" 1"
D["HAVE_ATEXIT"]=" 1"
D["HAVE_CBRT"]=" 1"
D["HAVE_HYPOT"]=" 1"
D["HAVE_ATAN2"]=" 1"
D["HAVE_CONTEXT_GET_HELP"]=" 1"
D["HAVE_MONOTONIC_TIME"]=" 1"
D["HAVE_MUTEX_INIT"]=" 1"
D["HAVE_COND_INIT"]=" 1"
D["HAVE_THREAD_NEW"]=" 1"
D["HAVE_PRIVATE_INIT"]=" 1"
D["HAVE_VALUE_GET_SCHAR"]=" 1"
D["HAVE_G_STR_TO_ASCII"]=" 1"
D["HAVE_CHECKED_MUL"]=" 1"
D["HAVE_EXPAT_H"]=" 1"
D["HAVE_GSF"]=" 1"
D["HAVE_GSF_ZIP64"]=" 1"
D["HAVE_GSF_DEFLATE_LEVEL"]=" 1"
D["HAVE_FFTW"]=" 1"
D["HAVE_MAGICK6"]=" 1"
D["HAVE_SETIMAGEOPTION"]=" 1"
D["HAVE_SETIMAGEOPTION"]=" 1"
D["HAVE_MAGICKCOREGENESIS"]=" 1"
D["HAVE_MAGICKCOREGENESIS"]=" 1"
D["HAVE_RESETIMAGEPROPERTYITERATOR"]=" 1"
D["HAVE_RESETIMAGEPROPERTYITERATOR"]=" 1"
D["HAVE_RESETIMAGEATTRIBUTEITERATOR"]=" 1"
D["HAVE_RESETIMAGEATTRIBUTEITERATOR"]=" 1"
D["HAVE_RESETIMAGEPROFILEITERATOR"]=" 1"
D["HAVE_RESETIMAGEPROFILEITERATOR"]=" 1"
D["HAVE_GETVIRTUALPIXELS"]=" 1"
D["HAVE_GETVIRTUALPIXELS"]=" 1"
D["HAVE_NUMBER_SCENES"]=" 1"
D["HAVE_ACQUIREIMAGE"]=" 1"
D["HAVE_ACQUIREIMAGE"]=" 1"
D["HAVE_SETIMAGEEXTENT"]=" 1"
D["HAVE_SETIMAGEEXTENT"]=" 1"
D["HAVE_SETIMAGEPROPERTY"]=" 1"
D["HAVE_SETIMAGEPROPERTY"]=" 1"
D["HAVE_BLOBTOSTRINGINFO"]=" 1"
D["HAVE_BLOBTOSTRINGINFO"]=" 1"
D["HAVE_INHERITEXCEPTION"]=" 1"
D["HAVE_INHERITEXCEPTION"]=" 1"
D["HAVE_ACQUIREEXCEPTIONINFO"]=" 1"
D["HAVE_ACQUIREEXCEPTIONINFO"]=" 1"
D["HAVE_IMPORTIMAGEPIXELS"]=" 1"
D["HAVE_IMPORTIMAGEPIXELS"]=" 1"
D["HAVE_IMAGESTOBLOB"]=" 1"
D["HAVE_IMAGESTOBLOB"]=" 1"
D["ENABLE_MAGICKLOAD"]=" 1"
D["ENABLE_MAGICKSAVE"]=" 1"
D["HAVE_ORC"]=" 1"
D["HAVE_ORC_PROGRAM_GET_ERROR"]=" 1"
D["HAVE_ORC_PROGRAM_GET_ERROR"]=" 1"
D["HAVE_LCMS2"]=" 1"
D["HAVE_OPENEXR"]=" 1"
D["HAVE_NIFTI"]=" 1"
D["HAVE_POPPLER"]=" 1"
D["HAVE_RSVG"]=" 1"
D["HAVE_ZLIB"]=" 1"
D["HAVE_OPENSLIDE_3_4"]=" 1"
D["HAVE_OPENSLIDE"]=" 1"
D["HAVE_MATIO"]=" 1"
D["HAVE_PPM"]=" 1"
D["HAVE_ANALYZE"]=" 1"
D["HAVE_RADIANCE"]=" 1"
D["HAVE_CFITSIO"]=" 1"
D["HAVE_LIBWEBP"]=" 1"
D["HAVE_PANGOFT2"]=" 1"
D["HAVE_TIFF"]=" 1"
D["HAVE_GIFLIB"]=" 1"
D["HAVE_PNG"]=" 1"
D["HAVE_JPEG"]=" 1"
D["HAVE_EXIF"]=" 1"
D["UNTAGGED_EXIF"]=" 1"
for (key in D) D_is_set[key] = 1
FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ {
line = $ 0
split(line, arg, " ")
if (arg[1] == "#") {
defundef = arg[2]
mac1 = arg[3]
} else {
defundef = substr(arg[1], 2)
mac1 = arg[2]
}
split(mac1, mac2, "(") #)
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
# Preserve the white space surrounding the "#".
print prefix "define", macro P[macro] D[macro]
next
} else {
# Replace #undef with comments. This is necessary, for example,
# in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
if (defundef == "undef") {
print "/*", prefix defundef, macro, "*/"
next
}
}
}
{ print }

389
confrLMsNU/subs.awk Normal file
View File

@ -0,0 +1,389 @@
BEGIN {
S["am__EXEEXT_FALSE"]=""
S["am__EXEEXT_TRUE"]="#"
S["LTLIBOBJS"]=""
S["TOP_SRCDIR"]="/home/john/GIT/libvips"
S["EXTRA_LIBS_USED"]=""
S["PACKAGES_USED"]=" glib-2.0 gmodule-2.0 gobject-2.0 libgsf-1 fftw3 MagickCore orc-0.4 lcms2 OpenEXR poppler-glib cairo librsvg-2.0 cairo zlib openslide matio cfitsio "\
"libwebp libwebpmux libwebpdemux pangoft2 libtiff-4 libpng libjpeg libexif"
S["VIPS_LIBS"]="-lz -lMagickCore-6.Q16 -lpng16 -lz -ltiff -ljpeg -Wl,--export-dynamic -lgmodule-2.0 -pthread -lgobject-2.0 -lglib-2.0 -lexpat -lpangoft2-1.0 -lp"\
"ango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgsf-1 -lgobject-2.0 -lglib-2.0 -lxml2 -lfftw3 -lorc-0.4 -llcms2 -lgif -lrsvg-2 -lm -lgio"\
"-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lniftiio -lznz -lpoppler-glib -lgobject-2.0 -lglib-2.0 -lcairo -lIlmImf -lImath -lHalf -lIe"\
"x -lIexMath -lIlmThread -lpthread -lopenslide -lcfitsio -lpthread -lwebpmux -lwebpdemux -lwebp -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lmatio "\
"-lhdf5 -lz -lexif -lm"
S["VIPS_INCLUDES"]=" -I/usr/include/nifti"
S["VIPS_CFLAGS"]="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"\
" -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/x86_64-linux-gnu -I/usr/include/uuid -I/usr/include/poppler/glib -I/usr/include/poppl"\
"er -I/usr/include/pixman-1 -I/usr/include/pango-1.0 -I/usr/include/orc-0.4 -I/usr/include/openslide -I/usr/include/libxml2 -I/usr/include/librsvg-2."\
"0 -I/usr/include/libpng16 -I/usr/include/libgsf-1 -I/usr/include/libexif -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/include/gdk-pixbuf-2"\
".0 -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/OpenEXR -I/usr/include/ImageMagick-6 -DMAGICKCORE_QUANTUM_DEP"\
"TH=16 -DMAGICKCORE_HDRI_ENABLE=0"
S["VIPS_LIBDIR"]="/home/john/vips/lib"
S["HAVE_PYTHON_FALSE"]=""
S["HAVE_PYTHON_TRUE"]="#"
S["PYTHON_INCLUDES"]=""
S["EXIF_LIBS"]="-lexif"
S["EXIF_CFLAGS"]="-I/usr/include/libexif"
S["JPEG_INCLUDES"]=""
S["JPEG_LIBS"]="-ljpeg"
S["JPEG_CFLAGS"]=""
S["IMAGEQUANT_LIBS"]=""
S["IMAGEQUANT_CFLAGS"]=""
S["PNG_INCLUDES"]=""
S["PNG_LIBS"]="-lpng16 -lz"
S["PNG_CFLAGS"]="-I/usr/include/libpng16"
S["GIFLIB_INCLUDES"]=""
S["GIFLIB_LIBS"]="-lgif"
S["TIFF_INCLUDES"]=""
S["TIFF_LIBS"]="-ltiff"
S["TIFF_CFLAGS"]="-I/usr/include/x86_64-linux-gnu"
S["ENABLE_PYVIPS8_FALSE"]=""
S["ENABLE_PYVIPS8_TRUE"]="#"
S["PYGOBJECT_LIBS"]=""
S["PYGOBJECT_CFLAGS"]=""
S["pkgpyexecdir"]=""
S["pyexecdir"]=""
S["pkgpythondir"]=""
S["pythondir"]=""
S["PYTHON_PLATFORM"]=""
S["PYTHON_EXEC_PREFIX"]=""
S["PYTHON_PREFIX"]=""
S["PYTHON_VERSION"]=""
S["PYTHON"]=""
S["PANGOFT2_LIBS"]="-lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"
S["PANGOFT2_CFLAGS"]="-I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu"\
"/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16"
S["LIBWEBP_LIBS"]="-lwebpmux -lwebpdemux -lwebp"
S["LIBWEBP_CFLAGS"]=""
S["CFITSIO_LIBS"]="-lcfitsio -lpthread"
S["CFITSIO_CFLAGS"]=""
S["MATIO_LIBS"]="-L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lmatio -lhdf5 -lz"
S["MATIO_CFLAGS"]="-I/usr/lib/x86_64-linux-gnu/hdf5/serial/include"
S["OPENSLIDE_LIBS"]="-lopenslide"
S["OPENSLIDE_CFLAGS"]="-I/usr/include/openslide"
S["ZLIB_INCLUDES"]=""
S["ZLIB_LIBS"]="-lz"
S["ZLIB_CFLAGS"]=""
S["RSVG_LIBS"]="-lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo"
S["RSVG_CFLAGS"]="-pthread -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/"\
"include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16"
S["POPPLER_LIBS"]="-lpoppler-glib -lgobject-2.0 -lglib-2.0 -lcairo"
S["POPPLER_CFLAGS"]="-I/usr/include/poppler/glib -I/usr/include/poppler -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/"\
"include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16"
S["PDFIUM_INCLUDES"]=""
S["PDFIUM_LIBS"]=""
S["HEIF_LIBS"]=""
S["HEIF_CFLAGS"]=""
S["NIFTI_INCLUDES"]="-I/usr/include/nifti"
S["NIFTI_LIBS"]="-lniftiio -lznz"
S["X_EXTRA_LIBS"]=""
S["X_LIBS"]=""
S["X_PRE_LIBS"]=" -lSM -lICE"
S["X_CFLAGS"]=""
S["XMKMF"]=""
S["OPENEXR_LIBS"]="-lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread -lpthread"
S["OPENEXR_CFLAGS"]="-I/usr/include/OpenEXR"
S["ENABLE_LCMS_FALSE"]="#"
S["ENABLE_LCMS_TRUE"]=""
S["LCMS_LIBS"]="-llcms2"
S["LCMS_CFLAGS"]=""
S["ORC_LIBS"]="-lorc-0.4"
S["ORC_CFLAGS"]="-I/usr/include/orc-0.4"
S["MAGICK_LIBS"]="-lMagickCore-6.Q16"
S["MAGICK_CFLAGS"]="-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6"
S["IMAGE_MAGICK_LIBS"]=""
S["IMAGE_MAGICK_CFLAGS"]=""
S["MAGICK_WAND_LIBS"]="-lMagickCore-6.Q16"
S["MAGICK_WAND_CFLAGS"]="-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6"
S["FFTW_LIBS"]="-lfftw3"
S["FFTW_CFLAGS"]=""
S["GSF_ZIP64_LIBS"]="-lgsf-1 -lgobject-2.0 -lglib-2.0 -lxml2"
S["GSF_ZIP64_CFLAGS"]="-I/usr/include/libgsf-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2"
S["GSF_LIBS"]="-lgsf-1 -lgobject-2.0 -lglib-2.0 -lxml2"
S["GSF_CFLAGS"]="-I/usr/include/libgsf-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2"
S["ENABLE_CPP7_FALSE"]=""
S["ENABLE_CPP7_TRUE"]="#"
S["EXPAT_LIBS"]=" -lexpat"
S["EXPAT_CFLAGS"]=""
S["GTK_DOC_USE_REBASE_FALSE"]="#"
S["GTK_DOC_USE_REBASE_TRUE"]=""
S["GTK_DOC_USE_LIBTOOL_FALSE"]="#"
S["GTK_DOC_USE_LIBTOOL_TRUE"]=""
S["GTK_DOC_BUILD_PDF_FALSE"]=""
S["GTK_DOC_BUILD_PDF_TRUE"]="#"
S["GTK_DOC_BUILD_HTML_FALSE"]="#"
S["GTK_DOC_BUILD_HTML_TRUE"]=""
S["ENABLE_GTK_DOC_FALSE"]=""
S["ENABLE_GTK_DOC_TRUE"]="#"
S["HAVE_GTK_DOC_FALSE"]="#"
S["HAVE_GTK_DOC_TRUE"]=""
S["GTKDOC_DEPS_LIBS"]="-lgobject-2.0 -lglib-2.0"
S["GTKDOC_DEPS_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["HTML_DIR"]="${datadir}/gtk-doc/html"
S["GTKDOC_MKPDF"]="/usr/bin/gtkdoc-mkpdf"
S["GTKDOC_REBASE"]="/usr/bin/gtkdoc-rebase"
S["GTKDOC_CHECK_PATH"]="/usr/bin/gtkdoc-check"
S["GTKDOC_CHECK"]="gtkdoc-check.test"
S["HAVE_CHECKED_MUL_LIBS"]="-lglib-2.0"
S["HAVE_CHECKED_MUL_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["STR_TO_ASCII_LIBS"]="-lglib-2.0"
S["STR_TO_ASCII_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["WIN32_GET_COMMAND_LINE_LIBS"]="-lglib-2.0"
S["WIN32_GET_COMMAND_LINE_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["TYPE_INIT_LIBS"]=""
S["TYPE_INIT_CFLAGS"]=""
S["GTHREAD_LIBS"]=""
S["GTHREAD_CFLAGS"]=""
S["THREADS_LIBS"]="-lglib-2.0"
S["THREADS_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["MONOTONIC_LIBS"]="-lglib-2.0"
S["MONOTONIC_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["CONTEXT_GET_HELP_LIBS"]="-lglib-2.0"
S["CONTEXT_GET_HELP_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["REQUIRED_LIBS"]="-Wl,--export-dynamic -lgmodule-2.0 -pthread -lgobject-2.0 -lglib-2.0"
S["REQUIRED_CFLAGS"]="-pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["LIBOBJS"]=""
S["CXXCPP"]="g++ -E"
S["LT_SYS_LIBRARY_PATH"]=""
S["OTOOL64"]=""
S["OTOOL"]=""
S["LIPO"]=""
S["NMEDIT"]=""
S["DSYMUTIL"]=""
S["MANIFEST_TOOL"]=":"
S["ac_ct_AR"]="ar"
S["NM"]="/usr/bin/nm -B"
S["ac_ct_DUMPBIN"]=""
S["DUMPBIN"]=""
S["FGREP"]="/bin/grep -F"
S["SED"]="/bin/sed"
S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool"
S["LD"]="ld -m elf_x86_64"
S["AR"]="ar"
S["DLLWRAP"]=""
S["OBJDUMP"]="objdump"
S["DLLTOOL"]="dlltool"
S["AS"]="as"
S["MKINSTALLDIRS"]="./mkinstalldirs"
S["POSUB"]="po"
S["POFILES"]=" en_GB.po de.po"
S["PO_IN_DATADIR_FALSE"]=""
S["PO_IN_DATADIR_TRUE"]=""
S["INTLLIBS"]=""
S["INSTOBJEXT"]=".mo"
S["GMOFILES"]=" en_GB.gmo de.gmo"
S["DATADIRNAME"]="share"
S["CATOBJEXT"]=".gmo"
S["CATALOGS"]=" en_GB.gmo de.gmo"
S["XGETTEXT"]="/usr/bin/xgettext"
S["GMSGFMT"]="/usr/bin/msgfmt"
S["MSGFMT_OPTS"]="-c"
S["MSGFMT"]="/usr/bin/msgfmt"
S["INTL_MACOSX_LIBS"]=""
S["USE_NLS"]="yes"
S["EGREP"]="/bin/grep -E"
S["GREP"]="/bin/grep"
S["CPP"]="gcc -E"
S["GETTEXT_PACKAGE"]="vips8.8"
S["VIPS_EXEEXT"]=""
S["LN_S"]="ln -s"
S["RANLIB"]="ranlib"
S["am__fastdepCXX_FALSE"]="#"
S["am__fastdepCXX_TRUE"]=""
S["CXXDEPMODE"]="depmode=gcc3"
S["ac_ct_CXX"]="g++"
S["CXXFLAGS"]="-O3"
S["CXX"]="g++"
S["am__fastdepCC_FALSE"]="#"
S["am__fastdepCC_TRUE"]=""
S["CCDEPMODE"]="depmode=gcc3"
S["am__nodep"]="_no"
S["AMDEPBACKSLASH"]="\\"
S["AMDEP_FALSE"]="#"
S["AMDEP_TRUE"]=""
S["am__include"]="include"
S["DEPDIR"]=".deps"
S["OBJEXT"]="o"
S["EXEEXT"]=""
S["ac_ct_CC"]="gcc"
S["CPPFLAGS"]=""
S["LDFLAGS"]=""
S["CFLAGS"]="-O3"
S["CC"]="gcc"
S["OS_WIN32_FALSE"]=""
S["OS_WIN32_TRUE"]="#"
S["VIPS_ENABLE_DEPRECATED"]="1"
S["ENABLE_DEPRECATED_FALSE"]="#"
S["ENABLE_DEPRECATED_TRUE"]=""
S["host_os"]="linux-gnu"
S["host_vendor"]="pc"
S["host_cpu"]="x86_64"
S["host"]="x86_64-pc-linux-gnu"
S["build_os"]="linux-gnu"
S["build_vendor"]="pc"
S["build_cpu"]="x86_64"
S["build"]="x86_64-pc-linux-gnu"
S["vips_introspection_sources"]=" ./create/sines.c ./create/grey.c ./create/mask_ideal.c ./create/create.c ./create/mask_gaussian.c ./create/xyz.c ./create/invertlut.c ./create/mask"\
"_butterworth_ring.c ./create/logmat.c ./create/gaussmat.c ./create/worley.c ./create/mask_gaussian_ring.c ./create/gaussnoise.c ./create/zone.c ./cr"\
"eate/tonelut.c ./create/perlin.c ./create/point.c ./create/mask.c ./create/mask_butterworth_band.c ./create/mask_ideal_ring.c ./create/mask_butterwo"\
"rth.c ./create/mask_gaussian_band.c ./create/fractsurf.c ./create/identity.c ./create/text.c ./create/mask_fractal.c ./create/eye.c ./create/black.c"\
" ./create/mask_ideal_band.c ./create/buildlut.c ./resample/affine.c ./resample/shrinkv.c ./resample/mapim.c ./resample/resize.c ./resample/transform"\
".c ./resample/reduce.c ./resample/shrinkh.c ./resample/resample.c ./resample/quadratic.c ./resample/thumbnail.c ./resample/shrink.c ./resample/simil"\
"arity.c ./resample/interpolate.c ./arithmetic/min.c ./arithmetic/sum.c ./arithmetic/stats.c ./arithmetic/project.c ./arithmetic/hough_line.c ./arith"\
"metic/binary.c ./arithmetic/deviate.c ./arithmetic/max.c ./arithmetic/statistic.c ./arithmetic/nary.c ./arithmetic/invert.c ./arithmetic/remainder.c"\
" ./arithmetic/boolean.c ./arithmetic/sign.c ./arithmetic/hist_find_ndim.c ./arithmetic/multiply.c ./arithmetic/hough_circle.c ./arithmetic/measure.c"\
" ./arithmetic/hist_find.c ./arithmetic/find_trim.c ./arithmetic/getpoint.c ./arithmetic/add.c ./arithmetic/divide.c ./arithmetic/relational.c ./arit"\
"hmetic/hough.c ./arithmetic/arithmetic.c ./arithmetic/abs.c ./arithmetic/avg.c ./arithmetic/linear.c ./arithmetic/round.c ./arithmetic/math2.c ./ari"\
"thmetic/unaryconst.c ./arithmetic/complex.c ./arithmetic/profile.c ./arithmetic/unary.c ./arithmetic/subtract.c ./arithmetic/hist_find_indexed.c ./a"\
"rithmetic/math.c ./mosaicing/im_tbmerge.c ./mosaicing/im_improve.c ./mosaicing/im_chkpair.c ./mosaicing/im_lrmosaic.c ./mosaicing/im_tbcalcon.c ./mo"\
"saicing/merge.c ./mosaicing/im_remosaic.c ./mosaicing/im_lrcalcon.c ./mosaicing/im_initialize.c ./mosaicing/mosaicing.c ./mosaicing/global_balance.c"\
" ./mosaicing/im_avgdxdy.c ./mosaicing/im_lrmerge.c ./mosaicing/mosaic.c ./mosaicing/im_tbmosaic.c ./mosaicing/im_clinear.c ./mosaicing/match.c ./mos"\
"aicing/mosaic1.c ./colour/LabQ2LabS.c ./colour/profile_load.c ./colour/rad2float.c ./colour/XYZ2scRGB.c ./colour/Lab2LabS.c ./colour/LabS2LabQ.c ./c"\
"olour/XYZ2CMYK.c ./colour/CMYK2XYZ.c ./colour/profiles.c ./colour/float2rad.c ./colour/scRGB2XYZ.c ./colour/LabQ2Lab.c ./colour/HSV2sRGB.c ./colour/"\
"XYZ2Lab.c ./colour/UCS2LCh.c ./colour/dE76.c ./colour/colour.c ./colour/sRGB2HSV.c ./colour/Lab2LabQ.c ./colour/LCh2UCS.c ./colour/sRGB2scRGB.c ./co"\
"lour/dECMC.c ./colour/LCh2Lab.c ./colour/Yxy2XYZ.c ./colour/LabS2Lab.c ./colour/LabQ2sRGB.c ./colour/scRGB2BW.c ./colour/Lab2LCh.c ./colour/icc_tran"\
"sform.c ./colour/scRGB2sRGB.c ./colour/dE00.c ./colour/Lab2XYZ.c ./colour/XYZ2Yxy.c ./colour/colourspace.c ./convolution/spcor.c ./convolution/conva"\
".c ./convolution/fastcor.c ./convolution/sobel.c ./convolution/canny.c ./convolution/convi.c ./convolution/compass.c ./convolution/convolution.c ./c"\
"onvolution/convf.c ./convolution/gaussblur.c ./convolution/convasep.c ./convolution/convsep.c ./convolution/sharpen.c ./convolution/conv.c ./convolu"\
"tion/correlation.c ./conversion/conversion.c ./conversion/embed.c ./conversion/zoom.c ./conversion/transpose3d.c ./conversion/replicate.c ./conversi"\
"on/bandfold.c ./conversion/wrap.c ./conversion/arrayjoin.c ./conversion/unpremultiply.c ./conversion/flip.c ./conversion/flatten.c ./conversion/copy"\
".c ./conversion/bandjoin.c ./conversion/rot45.c ./conversion/msb.c ./conversion/extract.c ./conversion/cast.c ./conversion/bandunfold.c ./conversion"\
"/tilecache.c ./conversion/sequential.c ./conversion/smartcrop.c ./conversion/premultiply.c ./conversion/bandmean.c ./conversion/falsecolour.c ./conv"\
"ersion/byteswap.c ./conversion/subsample.c ./conversion/bandbool.c ./conversion/recomb.c ./conversion/bandary.c ./conversion/ifthenelse.c ./conversi"\
"on/gamma.c ./conversion/join.c ./conversion/cache.c ./conversion/grid.c ./conversion/scale.c ./conversion/insert.c ./conversion/autorot.c ./conversi"\
"on/rot.c ./conversion/bandrank.c ./draw/draw_line.c ./draw/draw_image.c ./draw/draw_mask.c ./draw/draw.c ./draw/draw_smudge.c ./draw/drawink.c ./dra"\
"w/draw_circle.c ./draw/draw_flood.c ./draw/draw_rect.c ./freqfilt/spectrum.c ./freqfilt/phasecor.c ./freqfilt/fwfft.c ./freqfilt/freqmult.c ./freqfi"\
"lt/freqfilt.c ./freqfilt/invfft.c ./foreign/foreign.c ./foreign/ppm.c ./foreign/csvsave.c ./foreign/webp2vips.c ./foreign/pngload.c ./foreign/matlab"\
".c ./foreign/webpload.c ./foreign/pngsave.c ./foreign/magicksave.c ./foreign/niftiload.c ./foreign/tiff2vips.c ./foreign/fitsload.c ./foreign/matrix"\
"save.c ./foreign/vips2webp.c ./foreign/tiff.c ./foreign/ppmsave.c ./foreign/csv.c ./foreign/csvload.c ./foreign/vipspng.c ./foreign/heifsave.c ./for"\
"eign/vips2jpeg.c ./foreign/ppmload.c ./foreign/magickload.c ./foreign/openexr2vips.c ./foreign/gifload.c ./foreign/magick7load.c ./foreign/openslide"\
"2vips.c ./foreign/exif.c ./foreign/pdfload_pdfium.c ./foreign/fitssave.c ./foreign/pdfload.c ./foreign/heifload.c ./foreign/magick2vips.c ./foreign/"\
"fits.c ./foreign/cairo.c ./foreign/openslideload.c ./foreign/rawload.c ./foreign/jpeg2vips.c ./foreign/tiffsave.c ./foreign/svgload.c ./foreign/rads"\
"ave.c ./foreign/dzsave.c ./foreign/radload.c ./foreign/niftisave.c ./foreign/openexrload.c ./foreign/vipssave.c ./foreign/webpsave.c ./foreign/radia"\
"nce.c ./foreign/rawsave.c ./foreign/jpegsave.c ./foreign/analyze2vips.c ./foreign/matrixload.c ./foreign/jpegload.c ./foreign/magick.c ./foreign/ana"\
"lyzeload.c ./foreign/vips2tiff.c ./foreign/matload.c ./foreign/quantise.c ./foreign/vipsload.c ./foreign/tiffload.c ./morphology/morph.c ./morpholog"\
"y/rank.c ./morphology/countlines.c ./morphology/nearest.c ./morphology/labelregions.c ./morphology/morphology.c ./morphology/hitmiss.c ./iofuncs/sin"\
"k.c ./iofuncs/gate.c ./iofuncs/type.c ./iofuncs/image.c ./iofuncs/threadpool.c ./iofuncs/buffer.c ./iofuncs/mapfile.c ./iofuncs/reorder.c ./iofuncs/"\
"enumtypes.c ./iofuncs/sinkdisc.c ./iofuncs/vector.c ./iofuncs/operation.c ./iofuncs/sinkmemory.c ./iofuncs/generate.c ./iofuncs/dbuf.c ./iofuncs/win"\
"dow.c ./iofuncs/system.c ./iofuncs/header.c ./iofuncs/init.c ./iofuncs/rect.c ./iofuncs/region.c ./iofuncs/cache.c ./iofuncs/vips.c ./iofuncs/error."\
"c ./iofuncs/util.c ./iofuncs/semaphore.c ./iofuncs/memory.c ./iofuncs/sinkscreen.c ./iofuncs/object.c ./iofuncs/buf.c ./iofuncs/vipsmarshal.c ./iofu"\
"ncs/base64.c ./histogram/hist_match.c ./histogram/hist_cum.c ./histogram/hist_equal.c ./histogram/stdif.c ./histogram/histogram.c ./histogram/hist_e"\
"ntropy.c ./histogram/hist_ismonotonic.c ./histogram/hist_norm.c ./histogram/hist_plot.c ./histogram/hist_unary.c ./histogram/hist_local.c ./histogra"\
"m/percent.c ./histogram/maplut.c ./resample/reduceh.cpp ./resample/bicubic.cpp ./resample/vsqbs.cpp ./resample/nohalo.cpp ./resample/lbb.cpp ./resam"\
"ple/reducev.cpp ./conversion/composite.cpp include/vips/basic.h include/vips/vips.h include/vips/object.h include/vips/image.h include/vips/error.h "\
"include/vips/foreign.h include/vips/freqfilt.h include/vips/interpolate.h include/vips/header.h include/vips/histogram.h include/vips/operation.h in"\
"clude/vips/enumtypes.h include/vips/conversion.h include/vips/arithmetic.h include/vips/colour.h include/vips/convolution.h include/vips/create.h in"\
"clude/vips/draw.h include/vips/morphology.h include/vips/mosaicing.h include/vips/type.h include/vips/rect.h include/vips/resample.h include/vips/me"\
"mory.h include/vips/region.h"
S["HAVE_INTROSPECTION_FALSE"]="#"
S["HAVE_INTROSPECTION_TRUE"]=""
S["INTROSPECTION_MAKEFILE"]="/usr/share/gobject-introspection-1.0/Makefile.introspection"
S["INTROSPECTION_LIBS"]="-lgirepository-1.0 -lgobject-2.0 -lglib-2.0"
S["INTROSPECTION_CFLAGS"]="-pthread -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["INTROSPECTION_TYPELIBDIR"]="/usr/lib/x86_64-linux-gnu/girepository-1.0"
S["INTROSPECTION_GIRDIR"]="/usr/share/gir-1.0"
S["INTROSPECTION_GENERATE"]="/usr/bin/g-ir-generate"
S["INTROSPECTION_COMPILER"]="/usr/bin/g-ir-compiler"
S["INTROSPECTION_SCANNER"]="/usr/bin/g-ir-scanner"
S["PKG_CONFIG_LIBDIR"]=""
S["PKG_CONFIG_PATH"]="/home/john/vips/lib/pkgconfig"
S["PKG_CONFIG"]="/usr/bin/pkg-config"
S["LIBRARY_AGE"]="10"
S["LIBRARY_REVISION"]="0"
S["LIBRARY_CURRENT"]="52"
S["VIPS_MICRO_VERSION"]="0"
S["VIPS_MINOR_VERSION"]="8"
S["VIPS_MAJOR_VERSION"]="8"
S["VIPS_VERSION_STRING"]="8.8.0-Sun Feb 17 17:10:41 UTC 2019"
S["VIPS_VERSION"]="8.8.0"
S["AM_BACKSLASH"]="\\"
S["AM_DEFAULT_VERBOSITY"]="1"
S["AM_DEFAULT_V"]="$(AM_DEFAULT_VERBOSITY)"
S["AM_V"]="$(V)"
S["am__untar"]="$${TAR-tar} xf -"
S["am__tar"]="$${TAR-tar} chof - \"$$tardir\""
S["AMTAR"]="$${TAR-tar}"
S["am__leading_dot"]="."
S["SET_MAKE"]=""
S["AWK"]="gawk"
S["mkdir_p"]="$(MKDIR_P)"
S["MKDIR_P"]="/bin/mkdir -p"
S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
S["STRIP"]="strip"
S["install_sh"]="${SHELL} /home/john/GIT/libvips/install-sh"
S["MAKEINFO"]="${SHELL} /home/john/GIT/libvips/missing makeinfo"
S["AUTOHEADER"]="${SHELL} /home/john/GIT/libvips/missing autoheader"
S["AUTOMAKE"]="${SHELL} /home/john/GIT/libvips/missing automake-1.16"
S["AUTOCONF"]="${SHELL} /home/john/GIT/libvips/missing autoconf"
S["ACLOCAL"]="${SHELL} /home/john/GIT/libvips/missing aclocal-1.16"
S["VERSION"]="8.8.0"
S["PACKAGE"]="vips"
S["CYGPATH_W"]="echo"
S["am__isrc"]=""
S["INSTALL_DATA"]="${INSTALL} -m 644"
S["INSTALL_SCRIPT"]="${INSTALL}"
S["INSTALL_PROGRAM"]="${INSTALL}"
S["target_alias"]=""
S["host_alias"]=""
S["build_alias"]=""
S["LIBS"]=""
S["ECHO_T"]=""
S["ECHO_N"]="-n"
S["ECHO_C"]=""
S["DEFS"]="-DHAVE_CONFIG_H"
S["mandir"]="${datarootdir}/man"
S["localedir"]="${datarootdir}/locale"
S["libdir"]="${exec_prefix}/lib"
S["psdir"]="${docdir}"
S["pdfdir"]="${docdir}"
S["dvidir"]="${docdir}"
S["htmldir"]="${docdir}"
S["infodir"]="${datarootdir}/info"
S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}"
S["oldincludedir"]="/usr/include"
S["includedir"]="${prefix}/include"
S["runstatedir"]="${localstatedir}/run"
S["localstatedir"]="${prefix}/var"
S["sharedstatedir"]="${prefix}/com"
S["sysconfdir"]="${prefix}/etc"
S["datadir"]="${datarootdir}"
S["datarootdir"]="${prefix}/share"
S["libexecdir"]="${exec_prefix}/libexec"
S["sbindir"]="${exec_prefix}/sbin"
S["bindir"]="${exec_prefix}/bin"
S["program_transform_name"]="s,x,x,"
S["prefix"]="/home/john/vips"
S["exec_prefix"]="${prefix}"
S["PACKAGE_URL"]=""
S["PACKAGE_BUGREPORT"]="vipsip@jiscmail.ac.uk"
S["PACKAGE_STRING"]="vips 8.8.0"
S["PACKAGE_VERSION"]="8.8.0"
S["PACKAGE_TARNAME"]="vips"
S["PACKAGE_NAME"]="vips"
S["PATH_SEPARATOR"]=":"
S["SHELL"]="/bin/bash"
S["am__quote"]=""
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}

389
confrLMsNU/subs1.awk Normal file
View File

@ -0,0 +1,389 @@
BEGIN {
S["am__EXEEXT_FALSE"]=""
S["am__EXEEXT_TRUE"]="#"
S["LTLIBOBJS"]=""
S["TOP_SRCDIR"]="/home/john/GIT/libvips"
S["EXTRA_LIBS_USED"]=""
S["PACKAGES_USED"]=" glib-2.0 gmodule-2.0 gobject-2.0 libgsf-1 fftw3 MagickCore orc-0.4 lcms2 OpenEXR poppler-glib cairo librsvg-2.0 cairo zlib openslide matio cfitsio "\
"libwebp libwebpmux libwebpdemux pangoft2 libtiff-4 libpng libjpeg libexif"
S["VIPS_LIBS"]="-lz -lMagickCore-6.Q16 -lpng16 -lz -ltiff -ljpeg -Wl,--export-dynamic -lgmodule-2.0 -pthread -lgobject-2.0 -lglib-2.0 -lexpat -lpangoft2-1.0 -lp"\
"ango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgsf-1 -lgobject-2.0 -lglib-2.0 -lxml2 -lfftw3 -lorc-0.4 -llcms2 -lgif -lrsvg-2 -lm -lgio"\
"-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lniftiio -lznz -lpoppler-glib -lgobject-2.0 -lglib-2.0 -lcairo -lIlmImf -lImath -lHalf -lIe"\
"x -lIexMath -lIlmThread -lpthread -lopenslide -lcfitsio -lpthread -lwebpmux -lwebpdemux -lwebp -L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lmatio "\
"-lhdf5 -lz -lexif -lm"
S["VIPS_INCLUDES"]=" -I/usr/include/nifti"
S["VIPS_CFLAGS"]="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"\
" -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/x86_64-linux-gnu -I/usr/include/uuid -I/usr/include/poppler/glib -I/usr/include/poppl"\
"er -I/usr/include/pixman-1 -I/usr/include/pango-1.0 -I/usr/include/orc-0.4 -I/usr/include/openslide -I/usr/include/libxml2 -I/usr/include/librsvg-2."\
"0 -I/usr/include/libpng16 -I/usr/include/libgsf-1 -I/usr/include/libexif -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/include/gdk-pixbuf-2"\
".0 -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/OpenEXR -I/usr/include/ImageMagick-6 -DMAGICKCORE_QUANTUM_DEP"\
"TH=16 -DMAGICKCORE_HDRI_ENABLE=0"
S["VIPS_LIBDIR"]="/home/john/vips/lib"
S["HAVE_PYTHON_FALSE"]=""
S["HAVE_PYTHON_TRUE"]="#"
S["PYTHON_INCLUDES"]=""
S["EXIF_LIBS"]="-lexif"
S["EXIF_CFLAGS"]="-I/usr/include/libexif"
S["JPEG_INCLUDES"]=""
S["JPEG_LIBS"]="-ljpeg"
S["JPEG_CFLAGS"]=""
S["IMAGEQUANT_LIBS"]=""
S["IMAGEQUANT_CFLAGS"]=""
S["PNG_INCLUDES"]=""
S["PNG_LIBS"]="-lpng16 -lz"
S["PNG_CFLAGS"]="-I/usr/include/libpng16"
S["GIFLIB_INCLUDES"]=""
S["GIFLIB_LIBS"]="-lgif"
S["TIFF_INCLUDES"]=""
S["TIFF_LIBS"]="-ltiff"
S["TIFF_CFLAGS"]="-I/usr/include/x86_64-linux-gnu"
S["ENABLE_PYVIPS8_FALSE"]=""
S["ENABLE_PYVIPS8_TRUE"]="#"
S["PYGOBJECT_LIBS"]=""
S["PYGOBJECT_CFLAGS"]=""
S["pkgpyexecdir"]=""
S["pyexecdir"]=""
S["pkgpythondir"]=""
S["pythondir"]=""
S["PYTHON_PLATFORM"]=""
S["PYTHON_EXEC_PREFIX"]=""
S["PYTHON_PREFIX"]=""
S["PYTHON_VERSION"]=""
S["PYTHON"]=""
S["PANGOFT2_LIBS"]="-lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"
S["PANGOFT2_CFLAGS"]="-I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu"\
"/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16"
S["LIBWEBP_LIBS"]="-lwebpmux -lwebpdemux -lwebp"
S["LIBWEBP_CFLAGS"]=""
S["CFITSIO_LIBS"]="-lcfitsio -lpthread"
S["CFITSIO_CFLAGS"]=""
S["MATIO_LIBS"]="-L/usr/lib/x86_64-linux-gnu/hdf5/serial/lib -lmatio -lhdf5 -lz"
S["MATIO_CFLAGS"]="-I/usr/lib/x86_64-linux-gnu/hdf5/serial/include"
S["OPENSLIDE_LIBS"]="-lopenslide"
S["OPENSLIDE_CFLAGS"]="-I/usr/include/openslide"
S["ZLIB_INCLUDES"]=""
S["ZLIB_LIBS"]="-lz"
S["ZLIB_CFLAGS"]=""
S["RSVG_LIBS"]="-lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo"
S["RSVG_CFLAGS"]="-pthread -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/"\
"include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16"
S["POPPLER_LIBS"]="-lpoppler-glib -lgobject-2.0 -lglib-2.0 -lcairo"
S["POPPLER_CFLAGS"]="-I/usr/include/poppler/glib -I/usr/include/poppler -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/"\
"include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16"
S["PDFIUM_INCLUDES"]=""
S["PDFIUM_LIBS"]=""
S["HEIF_LIBS"]=""
S["HEIF_CFLAGS"]=""
S["NIFTI_INCLUDES"]="-I/usr/include/nifti"
S["NIFTI_LIBS"]="-lniftiio -lznz"
S["X_EXTRA_LIBS"]=""
S["X_LIBS"]=""
S["X_PRE_LIBS"]=" -lSM -lICE"
S["X_CFLAGS"]=""
S["XMKMF"]=""
S["OPENEXR_LIBS"]="-lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread -lpthread"
S["OPENEXR_CFLAGS"]="-I/usr/include/OpenEXR"
S["ENABLE_LCMS_FALSE"]="#"
S["ENABLE_LCMS_TRUE"]=""
S["LCMS_LIBS"]="-llcms2"
S["LCMS_CFLAGS"]=""
S["ORC_LIBS"]="-lorc-0.4"
S["ORC_CFLAGS"]="-I/usr/include/orc-0.4"
S["MAGICK_LIBS"]="-lMagickCore-6.Q16"
S["MAGICK_CFLAGS"]="-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6"
S["IMAGE_MAGICK_LIBS"]=""
S["IMAGE_MAGICK_CFLAGS"]=""
S["MAGICK_WAND_LIBS"]="-lMagickCore-6.Q16"
S["MAGICK_WAND_CFLAGS"]="-fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6"
S["FFTW_LIBS"]="-lfftw3"
S["FFTW_CFLAGS"]=""
S["GSF_ZIP64_LIBS"]="-lgsf-1 -lgobject-2.0 -lglib-2.0 -lxml2"
S["GSF_ZIP64_CFLAGS"]="-I/usr/include/libgsf-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2"
S["GSF_LIBS"]="-lgsf-1 -lgobject-2.0 -lglib-2.0 -lxml2"
S["GSF_CFLAGS"]="-I/usr/include/libgsf-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2"
S["ENABLE_CPP7_FALSE"]=""
S["ENABLE_CPP7_TRUE"]="#"
S["EXPAT_LIBS"]=" -lexpat"
S["EXPAT_CFLAGS"]=""
S["GTK_DOC_USE_REBASE_FALSE"]="#"
S["GTK_DOC_USE_REBASE_TRUE"]=""
S["GTK_DOC_USE_LIBTOOL_FALSE"]="#"
S["GTK_DOC_USE_LIBTOOL_TRUE"]=""
S["GTK_DOC_BUILD_PDF_FALSE"]=""
S["GTK_DOC_BUILD_PDF_TRUE"]="#"
S["GTK_DOC_BUILD_HTML_FALSE"]="#"
S["GTK_DOC_BUILD_HTML_TRUE"]=""
S["ENABLE_GTK_DOC_FALSE"]=""
S["ENABLE_GTK_DOC_TRUE"]="#"
S["HAVE_GTK_DOC_FALSE"]="#"
S["HAVE_GTK_DOC_TRUE"]=""
S["GTKDOC_DEPS_LIBS"]="-lgobject-2.0 -lglib-2.0"
S["GTKDOC_DEPS_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["HTML_DIR"]="${datadir}/gtk-doc/html"
S["GTKDOC_MKPDF"]="/usr/bin/gtkdoc-mkpdf"
S["GTKDOC_REBASE"]="/usr/bin/gtkdoc-rebase"
S["GTKDOC_CHECK_PATH"]="/usr/bin/gtkdoc-check"
S["GTKDOC_CHECK"]="gtkdoc-check.test"
S["HAVE_CHECKED_MUL_LIBS"]="-lglib-2.0"
S["HAVE_CHECKED_MUL_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["STR_TO_ASCII_LIBS"]="-lglib-2.0"
S["STR_TO_ASCII_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["WIN32_GET_COMMAND_LINE_LIBS"]="-lglib-2.0"
S["WIN32_GET_COMMAND_LINE_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["TYPE_INIT_LIBS"]=""
S["TYPE_INIT_CFLAGS"]=""
S["GTHREAD_LIBS"]=""
S["GTHREAD_CFLAGS"]=""
S["THREADS_LIBS"]="-lglib-2.0"
S["THREADS_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["MONOTONIC_LIBS"]="-lglib-2.0"
S["MONOTONIC_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["CONTEXT_GET_HELP_LIBS"]="-lglib-2.0"
S["CONTEXT_GET_HELP_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["REQUIRED_LIBS"]="-Wl,--export-dynamic -lgmodule-2.0 -pthread -lgobject-2.0 -lglib-2.0"
S["REQUIRED_CFLAGS"]="-pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["LIBOBJS"]=""
S["CXXCPP"]="g++ -E"
S["LT_SYS_LIBRARY_PATH"]=""
S["OTOOL64"]=""
S["OTOOL"]=""
S["LIPO"]=""
S["NMEDIT"]=""
S["DSYMUTIL"]=""
S["MANIFEST_TOOL"]=":"
S["ac_ct_AR"]="ar"
S["NM"]="/usr/bin/nm -B"
S["ac_ct_DUMPBIN"]=""
S["DUMPBIN"]=""
S["FGREP"]="/bin/grep -F"
S["SED"]="/bin/sed"
S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool"
S["LD"]="ld -m elf_x86_64"
S["AR"]="ar"
S["DLLWRAP"]=""
S["OBJDUMP"]="objdump"
S["DLLTOOL"]="dlltool"
S["AS"]="as"
S["MKINSTALLDIRS"]="./mkinstalldirs"
S["POSUB"]="po"
S["POFILES"]=" en_GB.po de.po"
S["PO_IN_DATADIR_FALSE"]=""
S["PO_IN_DATADIR_TRUE"]=""
S["INTLLIBS"]=""
S["INSTOBJEXT"]=".mo"
S["GMOFILES"]=" en_GB.gmo de.gmo"
S["DATADIRNAME"]="share"
S["CATOBJEXT"]=".gmo"
S["CATALOGS"]=" en_GB.gmo de.gmo"
S["XGETTEXT"]="/usr/bin/xgettext"
S["GMSGFMT"]="/usr/bin/msgfmt"
S["MSGFMT_OPTS"]="-c"
S["MSGFMT"]="/usr/bin/msgfmt"
S["INTL_MACOSX_LIBS"]=""
S["USE_NLS"]="yes"
S["EGREP"]="/bin/grep -E"
S["GREP"]="/bin/grep"
S["CPP"]="gcc -E"
S["GETTEXT_PACKAGE"]="vips8.8"
S["VIPS_EXEEXT"]=""
S["LN_S"]="ln -s"
S["RANLIB"]="ranlib"
S["am__fastdepCXX_FALSE"]="#"
S["am__fastdepCXX_TRUE"]=""
S["CXXDEPMODE"]="depmode=gcc3"
S["ac_ct_CXX"]="g++"
S["CXXFLAGS"]="-O3"
S["CXX"]="g++"
S["am__fastdepCC_FALSE"]="#"
S["am__fastdepCC_TRUE"]=""
S["CCDEPMODE"]="depmode=gcc3"
S["am__nodep"]="_no"
S["AMDEPBACKSLASH"]="\\"
S["AMDEP_FALSE"]="#"
S["AMDEP_TRUE"]=""
S["am__include"]="include"
S["DEPDIR"]=".deps"
S["OBJEXT"]="o"
S["EXEEXT"]=""
S["ac_ct_CC"]="gcc"
S["CPPFLAGS"]=""
S["LDFLAGS"]=""
S["CFLAGS"]="-O3"
S["CC"]="gcc"
S["OS_WIN32_FALSE"]=""
S["OS_WIN32_TRUE"]="#"
S["VIPS_ENABLE_DEPRECATED"]="1"
S["ENABLE_DEPRECATED_FALSE"]="#"
S["ENABLE_DEPRECATED_TRUE"]=""
S["host_os"]="linux-gnu"
S["host_vendor"]="pc"
S["host_cpu"]="x86_64"
S["host"]="x86_64-pc-linux-gnu"
S["build_os"]="linux-gnu"
S["build_vendor"]="pc"
S["build_cpu"]="x86_64"
S["build"]="x86_64-pc-linux-gnu"
S["vips_introspection_sources"]=" ./create/sines.c ./create/grey.c ./create/mask_ideal.c ./create/create.c ./create/mask_gaussian.c ./create/xyz.c ./create/invertlut.c ./create/mask"\
"_butterworth_ring.c ./create/logmat.c ./create/gaussmat.c ./create/worley.c ./create/mask_gaussian_ring.c ./create/gaussnoise.c ./create/zone.c ./cr"\
"eate/tonelut.c ./create/perlin.c ./create/point.c ./create/mask.c ./create/mask_butterworth_band.c ./create/mask_ideal_ring.c ./create/mask_butterwo"\
"rth.c ./create/mask_gaussian_band.c ./create/fractsurf.c ./create/identity.c ./create/text.c ./create/mask_fractal.c ./create/eye.c ./create/black.c"\
" ./create/mask_ideal_band.c ./create/buildlut.c ./resample/affine.c ./resample/shrinkv.c ./resample/mapim.c ./resample/resize.c ./resample/transform"\
".c ./resample/reduce.c ./resample/shrinkh.c ./resample/resample.c ./resample/quadratic.c ./resample/thumbnail.c ./resample/shrink.c ./resample/simil"\
"arity.c ./resample/interpolate.c ./arithmetic/min.c ./arithmetic/sum.c ./arithmetic/stats.c ./arithmetic/project.c ./arithmetic/hough_line.c ./arith"\
"metic/binary.c ./arithmetic/deviate.c ./arithmetic/max.c ./arithmetic/statistic.c ./arithmetic/nary.c ./arithmetic/invert.c ./arithmetic/remainder.c"\
" ./arithmetic/boolean.c ./arithmetic/sign.c ./arithmetic/hist_find_ndim.c ./arithmetic/multiply.c ./arithmetic/hough_circle.c ./arithmetic/measure.c"\
" ./arithmetic/hist_find.c ./arithmetic/find_trim.c ./arithmetic/getpoint.c ./arithmetic/add.c ./arithmetic/divide.c ./arithmetic/relational.c ./arit"\
"hmetic/hough.c ./arithmetic/arithmetic.c ./arithmetic/abs.c ./arithmetic/avg.c ./arithmetic/linear.c ./arithmetic/round.c ./arithmetic/math2.c ./ari"\
"thmetic/unaryconst.c ./arithmetic/complex.c ./arithmetic/profile.c ./arithmetic/unary.c ./arithmetic/subtract.c ./arithmetic/hist_find_indexed.c ./a"\
"rithmetic/math.c ./mosaicing/im_tbmerge.c ./mosaicing/im_improve.c ./mosaicing/im_chkpair.c ./mosaicing/im_lrmosaic.c ./mosaicing/im_tbcalcon.c ./mo"\
"saicing/merge.c ./mosaicing/im_remosaic.c ./mosaicing/im_lrcalcon.c ./mosaicing/im_initialize.c ./mosaicing/mosaicing.c ./mosaicing/global_balance.c"\
" ./mosaicing/im_avgdxdy.c ./mosaicing/im_lrmerge.c ./mosaicing/mosaic.c ./mosaicing/im_tbmosaic.c ./mosaicing/im_clinear.c ./mosaicing/match.c ./mos"\
"aicing/mosaic1.c ./colour/LabQ2LabS.c ./colour/profile_load.c ./colour/rad2float.c ./colour/XYZ2scRGB.c ./colour/Lab2LabS.c ./colour/LabS2LabQ.c ./c"\
"olour/XYZ2CMYK.c ./colour/CMYK2XYZ.c ./colour/profiles.c ./colour/float2rad.c ./colour/scRGB2XYZ.c ./colour/LabQ2Lab.c ./colour/HSV2sRGB.c ./colour/"\
"XYZ2Lab.c ./colour/UCS2LCh.c ./colour/dE76.c ./colour/colour.c ./colour/sRGB2HSV.c ./colour/Lab2LabQ.c ./colour/LCh2UCS.c ./colour/sRGB2scRGB.c ./co"\
"lour/dECMC.c ./colour/LCh2Lab.c ./colour/Yxy2XYZ.c ./colour/LabS2Lab.c ./colour/LabQ2sRGB.c ./colour/scRGB2BW.c ./colour/Lab2LCh.c ./colour/icc_tran"\
"sform.c ./colour/scRGB2sRGB.c ./colour/dE00.c ./colour/Lab2XYZ.c ./colour/XYZ2Yxy.c ./colour/colourspace.c ./convolution/spcor.c ./convolution/conva"\
".c ./convolution/fastcor.c ./convolution/sobel.c ./convolution/canny.c ./convolution/convi.c ./convolution/compass.c ./convolution/convolution.c ./c"\
"onvolution/convf.c ./convolution/gaussblur.c ./convolution/convasep.c ./convolution/convsep.c ./convolution/sharpen.c ./convolution/conv.c ./convolu"\
"tion/correlation.c ./conversion/conversion.c ./conversion/embed.c ./conversion/zoom.c ./conversion/transpose3d.c ./conversion/replicate.c ./conversi"\
"on/bandfold.c ./conversion/wrap.c ./conversion/arrayjoin.c ./conversion/unpremultiply.c ./conversion/flip.c ./conversion/flatten.c ./conversion/copy"\
".c ./conversion/bandjoin.c ./conversion/rot45.c ./conversion/msb.c ./conversion/extract.c ./conversion/cast.c ./conversion/bandunfold.c ./conversion"\
"/tilecache.c ./conversion/sequential.c ./conversion/smartcrop.c ./conversion/premultiply.c ./conversion/bandmean.c ./conversion/falsecolour.c ./conv"\
"ersion/byteswap.c ./conversion/subsample.c ./conversion/bandbool.c ./conversion/recomb.c ./conversion/bandary.c ./conversion/ifthenelse.c ./conversi"\
"on/gamma.c ./conversion/join.c ./conversion/cache.c ./conversion/grid.c ./conversion/scale.c ./conversion/insert.c ./conversion/autorot.c ./conversi"\
"on/rot.c ./conversion/bandrank.c ./draw/draw_line.c ./draw/draw_image.c ./draw/draw_mask.c ./draw/draw.c ./draw/draw_smudge.c ./draw/drawink.c ./dra"\
"w/draw_circle.c ./draw/draw_flood.c ./draw/draw_rect.c ./freqfilt/spectrum.c ./freqfilt/phasecor.c ./freqfilt/fwfft.c ./freqfilt/freqmult.c ./freqfi"\
"lt/freqfilt.c ./freqfilt/invfft.c ./foreign/foreign.c ./foreign/ppm.c ./foreign/csvsave.c ./foreign/webp2vips.c ./foreign/pngload.c ./foreign/matlab"\
".c ./foreign/webpload.c ./foreign/pngsave.c ./foreign/magicksave.c ./foreign/niftiload.c ./foreign/tiff2vips.c ./foreign/fitsload.c ./foreign/matrix"\
"save.c ./foreign/vips2webp.c ./foreign/tiff.c ./foreign/ppmsave.c ./foreign/csv.c ./foreign/csvload.c ./foreign/vipspng.c ./foreign/heifsave.c ./for"\
"eign/vips2jpeg.c ./foreign/ppmload.c ./foreign/magickload.c ./foreign/openexr2vips.c ./foreign/gifload.c ./foreign/magick7load.c ./foreign/openslide"\
"2vips.c ./foreign/exif.c ./foreign/pdfload_pdfium.c ./foreign/fitssave.c ./foreign/pdfload.c ./foreign/heifload.c ./foreign/magick2vips.c ./foreign/"\
"fits.c ./foreign/cairo.c ./foreign/openslideload.c ./foreign/rawload.c ./foreign/jpeg2vips.c ./foreign/tiffsave.c ./foreign/svgload.c ./foreign/rads"\
"ave.c ./foreign/dzsave.c ./foreign/radload.c ./foreign/niftisave.c ./foreign/openexrload.c ./foreign/vipssave.c ./foreign/webpsave.c ./foreign/radia"\
"nce.c ./foreign/rawsave.c ./foreign/jpegsave.c ./foreign/analyze2vips.c ./foreign/matrixload.c ./foreign/jpegload.c ./foreign/magick.c ./foreign/ana"\
"lyzeload.c ./foreign/vips2tiff.c ./foreign/matload.c ./foreign/quantise.c ./foreign/vipsload.c ./foreign/tiffload.c ./morphology/morph.c ./morpholog"\
"y/rank.c ./morphology/countlines.c ./morphology/nearest.c ./morphology/labelregions.c ./morphology/morphology.c ./morphology/hitmiss.c ./iofuncs/sin"\
"k.c ./iofuncs/gate.c ./iofuncs/type.c ./iofuncs/image.c ./iofuncs/threadpool.c ./iofuncs/buffer.c ./iofuncs/mapfile.c ./iofuncs/reorder.c ./iofuncs/"\
"enumtypes.c ./iofuncs/sinkdisc.c ./iofuncs/vector.c ./iofuncs/operation.c ./iofuncs/sinkmemory.c ./iofuncs/generate.c ./iofuncs/dbuf.c ./iofuncs/win"\
"dow.c ./iofuncs/system.c ./iofuncs/header.c ./iofuncs/init.c ./iofuncs/rect.c ./iofuncs/region.c ./iofuncs/cache.c ./iofuncs/vips.c ./iofuncs/error."\
"c ./iofuncs/util.c ./iofuncs/semaphore.c ./iofuncs/memory.c ./iofuncs/sinkscreen.c ./iofuncs/object.c ./iofuncs/buf.c ./iofuncs/vipsmarshal.c ./iofu"\
"ncs/base64.c ./histogram/hist_match.c ./histogram/hist_cum.c ./histogram/hist_equal.c ./histogram/stdif.c ./histogram/histogram.c ./histogram/hist_e"\
"ntropy.c ./histogram/hist_ismonotonic.c ./histogram/hist_norm.c ./histogram/hist_plot.c ./histogram/hist_unary.c ./histogram/hist_local.c ./histogra"\
"m/percent.c ./histogram/maplut.c ./resample/reduceh.cpp ./resample/bicubic.cpp ./resample/vsqbs.cpp ./resample/nohalo.cpp ./resample/lbb.cpp ./resam"\
"ple/reducev.cpp ./conversion/composite.cpp include/vips/basic.h include/vips/vips.h include/vips/object.h include/vips/image.h include/vips/error.h "\
"include/vips/foreign.h include/vips/freqfilt.h include/vips/interpolate.h include/vips/header.h include/vips/histogram.h include/vips/operation.h in"\
"clude/vips/enumtypes.h include/vips/conversion.h include/vips/arithmetic.h include/vips/colour.h include/vips/convolution.h include/vips/create.h in"\
"clude/vips/draw.h include/vips/morphology.h include/vips/mosaicing.h include/vips/type.h include/vips/rect.h include/vips/resample.h include/vips/me"\
"mory.h include/vips/region.h"
S["HAVE_INTROSPECTION_FALSE"]="#"
S["HAVE_INTROSPECTION_TRUE"]=""
S["INTROSPECTION_MAKEFILE"]="/usr/share/gobject-introspection-1.0/Makefile.introspection"
S["INTROSPECTION_LIBS"]="-lgirepository-1.0 -lgobject-2.0 -lglib-2.0"
S["INTROSPECTION_CFLAGS"]="-pthread -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include"
S["INTROSPECTION_TYPELIBDIR"]="/usr/lib/x86_64-linux-gnu/girepository-1.0"
S["INTROSPECTION_GIRDIR"]="/usr/share/gir-1.0"
S["INTROSPECTION_GENERATE"]="/usr/bin/g-ir-generate"
S["INTROSPECTION_COMPILER"]="/usr/bin/g-ir-compiler"
S["INTROSPECTION_SCANNER"]="/usr/bin/g-ir-scanner"
S["PKG_CONFIG_LIBDIR"]=""
S["PKG_CONFIG_PATH"]="/home/john/vips/lib/pkgconfig"
S["PKG_CONFIG"]="/usr/bin/pkg-config"
S["LIBRARY_AGE"]="10"
S["LIBRARY_REVISION"]="0"
S["LIBRARY_CURRENT"]="52"
S["VIPS_MICRO_VERSION"]="0"
S["VIPS_MINOR_VERSION"]="8"
S["VIPS_MAJOR_VERSION"]="8"
S["VIPS_VERSION_STRING"]="8.8.0-Sun Feb 17 17:10:41 UTC 2019"
S["VIPS_VERSION"]="8.8.0"
S["AM_BACKSLASH"]="\\"
S["AM_DEFAULT_VERBOSITY"]="1"
S["AM_DEFAULT_V"]="$(AM_DEFAULT_VERBOSITY)"
S["AM_V"]="$(V)"
S["am__untar"]="$${TAR-tar} xf -"
S["am__tar"]="$${TAR-tar} chof - \"$$tardir\""
S["AMTAR"]="$${TAR-tar}"
S["am__leading_dot"]="."
S["SET_MAKE"]=""
S["AWK"]="gawk"
S["mkdir_p"]="$(MKDIR_P)"
S["MKDIR_P"]="/bin/mkdir -p"
S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
S["STRIP"]="strip"
S["install_sh"]="${SHELL} /home/john/GIT/libvips/install-sh"
S["MAKEINFO"]="${SHELL} /home/john/GIT/libvips/missing makeinfo"
S["AUTOHEADER"]="${SHELL} /home/john/GIT/libvips/missing autoheader"
S["AUTOMAKE"]="${SHELL} /home/john/GIT/libvips/missing automake-1.16"
S["AUTOCONF"]="${SHELL} /home/john/GIT/libvips/missing autoconf"
S["ACLOCAL"]="${SHELL} /home/john/GIT/libvips/missing aclocal-1.16"
S["VERSION"]="8.8.0"
S["PACKAGE"]="vips"
S["CYGPATH_W"]="echo"
S["am__isrc"]=""
S["INSTALL_DATA"]="${INSTALL} -m 644"
S["INSTALL_SCRIPT"]="${INSTALL}"
S["INSTALL_PROGRAM"]="${INSTALL}"
S["target_alias"]=""
S["host_alias"]=""
S["build_alias"]=""
S["LIBS"]=""
S["ECHO_T"]=""
S["ECHO_N"]="-n"
S["ECHO_C"]=""
S["DEFS"]="-DHAVE_CONFIG_H"
S["mandir"]="${datarootdir}/man"
S["localedir"]="${datarootdir}/locale"
S["libdir"]="${exec_prefix}/lib"
S["psdir"]="${docdir}"
S["pdfdir"]="${docdir}"
S["dvidir"]="${docdir}"
S["htmldir"]="${docdir}"
S["infodir"]="${datarootdir}/info"
S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}"
S["oldincludedir"]="/usr/include"
S["includedir"]="${prefix}/include"
S["runstatedir"]="${localstatedir}/run"
S["localstatedir"]="${prefix}/var"
S["sharedstatedir"]="${prefix}/com"
S["sysconfdir"]="${prefix}/etc"
S["datadir"]="${datarootdir}"
S["datarootdir"]="${prefix}/share"
S["libexecdir"]="${exec_prefix}/libexec"
S["sbindir"]="${exec_prefix}/sbin"
S["bindir"]="${exec_prefix}/bin"
S["program_transform_name"]="s,x,x,"
S["prefix"]="/home/john/vips"
S["exec_prefix"]="${prefix}"
S["PACKAGE_URL"]=""
S["PACKAGE_BUGREPORT"]="vipsip@jiscmail.ac.uk"
S["PACKAGE_STRING"]="vips 8.8.0"
S["PACKAGE_VERSION"]="8.8.0"
S["PACKAGE_TARNAME"]="vips"
S["PACKAGE_NAME"]="vips"
S["PATH_SEPARATOR"]=":"
S["SHELL"]="/bin/bash"
S["am__quote"]=""
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}

View File

@ -2,6 +2,8 @@ noinst_LTLIBRARIES = libforeign.la
libforeign_la_SOURCES = \
pforeign.h \
heifload.c \
heifsave.c \
niftiload.c \
niftisave.c \
quantise.c \

View File

@ -1827,6 +1827,12 @@ vips_foreign_operation_init( void )
extern GType vips_foreign_load_svg_get_type( void );
extern GType vips_foreign_load_svg_file_get_type( void );
extern GType vips_foreign_load_svg_buffer_get_type( void );
extern GType vips_foreign_load_heif_get_type( void );
extern GType vips_foreign_load_heif_file_get_type( void );
extern GType vips_foreign_load_heif_buffer_get_type( void );
extern GType vips_foreign_save_heif_get_type( void );
extern GType vips_foreign_save_heif_file_get_type( void );
extern GType vips_foreign_save_heif_buffer_get_type( void );
extern GType vips_foreign_load_nifti_get_type( void );
extern GType vips_foreign_save_nifti_get_type( void );
extern GType vips_foreign_load_gif_get_type( void );
@ -1956,6 +1962,15 @@ vips_foreign_operation_init( void )
vips_foreign_save_nifti_get_type();
#endif /*HAVE_NIFTI*/
#ifdef HAVE_HEIF
vips_foreign_load_heif_get_type();
vips_foreign_load_heif_file_get_type();
vips_foreign_load_heif_buffer_get_type();
vips_foreign_save_heif_get_type();
vips_foreign_save_heif_file_get_type();
vips_foreign_save_heif_buffer_get_type();
#endif /*HAVE_HEIF*/
vips__foreign_load_operation =
g_quark_from_static_string( "vips-foreign-load-operation" );
}

895
libvips/foreign/heifload.c Normal file
View File

@ -0,0 +1,895 @@
/* load heif images with libheif
*
* 19/1/19
* - from niftiload.c
*/
/*
This file is part of VIPS.
VIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
/*
#define VIPS_DEBUG
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vips/vips.h>
#include <vips/debug.h>
#include <vips/internal.h>
#ifdef HAVE_HEIF
#include <libheif/heif.h>
#include "pforeign.h"
typedef struct _VipsForeignLoadHeif {
VipsForeignLoad parent_object;
/* Pages to load.
*/
int page;
int n;
/* Set to apply image transforms (flip, rotate, crop) stored in the file
* header.
*/
gboolean autorotate;
/* Fetch the thumbnail instead of the image. If there is no thumbnail,
* just fetch the image.
*/
gboolean thumbnail;
/* Context for this image.
*/
struct heif_context *ctx;
/* Number of top-level images in this file.
*/
int n_top;
/* Size of final output image.
*/
int width;
int height;
/* Size of each page.
*/
int page_width;
int page_height;
/* The page number currently in @handle.
*/
int page_no;
/* TRUE if @handle has selected the thumbnail rather than the main
* image.
*/
gboolean thumbnail_set;
/* The page number of the primary image.
*/
int primary_page;
/* Array of top-level image IDs.
*/
heif_item_id *id;
/* Handle for the currently selected image.
*/
struct heif_image_handle *handle;
/* Decoded pixel data for the current image.
*/
struct heif_image *img;
/* Valid until img is released.
*/
int stride;
const uint8_t *data;
} VipsForeignLoadHeif;
typedef VipsForeignLoadClass VipsForeignLoadHeifClass;
G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadHeif, vips_foreign_load_heif,
VIPS_TYPE_FOREIGN_LOAD );
static void
vips_foreign_load_heif_dispose( GObject *gobject )
{
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) gobject;
VIPS_FREEF( heif_image_release, heif->img );
VIPS_FREEF( heif_image_handle_release, heif->handle );
VIPS_FREEF( heif_context_free, heif->ctx );
VIPS_FREE( heif->id );
G_OBJECT_CLASS( vips_foreign_load_heif_parent_class )->
dispose( gobject );
}
void
vips__heif_error( struct heif_error *error )
{
if( error->code )
vips_error( "heifload", "%s", error->message );
}
static const char *heif_magic[] = {
"ftypheic", /* A regular heif image */
"ftypheix", /* Extended range (>8 bit) image */
"ftyphevc", /* Image sequence */
"ftypheim", /* Image sequence */
"ftypheis", /* Scaleable image */
"ftyphevm", /* Multiview sequence */
"ftyphevs", /* Scaleable sequence */
"ftypmif1", /* Nokia alpha_ image */
"ftypmsf1" /* Nokia animation image */
};
/* THe API has:
*
* enum heif_filetype_result result = heif_check_filetype( buf, 12 );
*
* but it's very conservative and seems to be missing some of the Noka hief
* types.
*/
static int
vips_foreign_load_heif_is_a( const char *buf, int len )
{
if( len >= 12 ) {
int i;
for( i = 0; i < VIPS_NUMBER( heif_magic ); i++ )
if( strncmp( buf + 4, heif_magic[i], 8 ) == 0 )
return( 1 );
}
return( 0 );
}
static VipsForeignFlags
vips_foreign_load_heif_get_flags( VipsForeignLoad *load )
{
/* FIXME .. could support random access for grid images.
*/
return( VIPS_FOREIGN_SEQUENTIAL );
}
/* Select a page. If thumbnail is set, select the thumbnail for that page, if
* there is one.
*/
static int
vips_foreign_load_heif_set_page( VipsForeignLoadHeif *heif,
int page_no, gboolean thumbnail )
{
if( !heif->handle ||
page_no != heif->page_no ||
thumbnail != heif->thumbnail_set ) {
struct heif_error error;
VIPS_FREEF( heif_image_handle_release, heif->handle );
VIPS_FREEF( heif_image_release, heif->img );
heif->data = NULL;
heif->thumbnail_set = FALSE;
error = heif_context_get_image_handle( heif->ctx,
heif->id[page_no], &heif->handle );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
if( thumbnail ) {
heif_item_id thumb_ids[1];
int n_thumbs;
struct heif_image_handle *thumb_handle;
n_thumbs = heif_image_handle_get_list_of_thumbnail_IDs(
heif->handle, thumb_ids, 1 );
if( n_thumbs > 0 ) {
error = heif_image_handle_get_thumbnail(
heif->handle,
thumb_ids[0], &thumb_handle );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
VIPS_FREEF( heif_image_handle_release,
heif->handle );
heif->handle = thumb_handle;
heif->thumbnail_set = TRUE;
}
}
heif->page_no = page_no;
}
return( 0 );
}
static int
vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out )
{
/* FIXME ... never seen this return TRUE on any image, strangely.
*/
gboolean has_alpha =
heif_image_handle_has_alpha_channel( heif->handle );
int bands = has_alpha ? 4 : 3;
/* Surely, 16 metadata items will be enough for anyone.
*/
int i;
heif_item_id id[16];
int n_metadata;
struct heif_error error;
/* FIXME .. we always decode to RGB in generate. We should check for
* all grey images, perhaps.
*/
vips_image_pipelinev( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL );
vips_image_init_fields( out,
heif->page_width, heif->page_height * heif->n, bands,
VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB,
1.0, 1.0 );
vips_image_set_int( out, "heif-primary", heif->primary_page );
vips_image_set_int( out, "n-pages", heif->n_top );
vips_image_set_int( out, "page-height", heif->page_height );
/* FIXME .. need to test XMP and IPCT.
*/
n_metadata = heif_image_handle_get_list_of_metadata_block_IDs(
heif->handle, NULL, id, VIPS_NUMBER( id ) );
for( i = 0; i < n_metadata; i++ ) {
size_t length = heif_image_handle_get_metadata_size(
heif->handle, id[i] );
const char *type = heif_image_handle_get_metadata_type(
heif->handle, id[i] );
unsigned char *data;
char name[256];
#ifdef DEBUG
printf( "metadata type = %s, length = %zd\n", type, length );
#endif /*DEBUG*/
if( !(data = VIPS_ARRAY( out, length, unsigned char )) )
return( -1 );
error = heif_image_handle_get_metadata(
heif->handle, id[i], data );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
/* We need to skip the first four bytes of EXIF, they just
* contain the offset.
*/
if( strcasecmp( type, "exif" ) == 0 ) {
data += 4;
length -= 4;
}
/* exif has a special name.
*
* XMP metadata is just attached with the "mime" type, and
* usually start with "<x:xmpmeta".
*/
if( strcasecmp( type, "exif" ) == 0 )
vips_snprintf( name, 256, VIPS_META_EXIF_NAME );
else if( strcasecmp( type, "mime" ) == 0 &&
vips_isprefix( "<x:xmpmeta", (const char *) data ) )
snprintf( name, 256, VIPS_META_XMP_NAME );
else
vips_snprintf( name, 256, "heif-%s-%d", type, i );
vips_image_set_blob( out, name,
(VipsCallbackFn) NULL, data, length );
if( strcasecmp( type, "exif" ) == 0 )
(void) vips__exif_parse( out );
}
#ifdef DEBUG
{
enum heif_color_profile_type profile_type =
heif_image_handle_get_color_profile_type( heif->handle );
switch( profile_type ) {
case heif_color_profile_type_not_present:
printf( "no profile\n" );
break;
case heif_color_profile_type_nclx:
printf( "nclx profile\n" );
break;
case heif_color_profile_type_rICC:
printf( "rICC profile\n" );
break;
case heif_color_profile_type_prof:
printf( "prof profile\n" );
break;
default:
printf( "unknown profile type\n" );
break;
}
}
#endif /*DEBUG*/
/* FIXME should probably check the profile type ... lcms seems to be
* able to load at least rICC and prof.
*/
if( heif_image_handle_get_color_profile_type( heif->handle ) ) {
size_t length = heif_image_handle_get_raw_color_profile_size(
heif->handle );
unsigned char *data;
if( !(data = VIPS_ARRAY( out, length, unsigned char )) )
return( -1 );
error = heif_image_handle_get_raw_color_profile(
heif->handle, data );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
#ifdef DEBUG
printf( "profile data, length = %zd\n", length );
#endif /*DEBUG*/
vips_image_set_blob( out, VIPS_META_ICC_NAME,
(VipsCallbackFn) NULL, data, length );
}
return( 0 );
}
static int
vips_foreign_load_heif_header( VipsForeignLoad *load )
{
VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load );
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) load;
struct heif_error error;
heif_item_id primary_id;
int i;
heif->n_top = heif_context_get_number_of_top_level_images( heif->ctx );
heif->id = VIPS_ARRAY( NULL, heif->n_top, heif_item_id );
heif_context_get_list_of_top_level_image_IDs( heif->ctx,
heif->id, heif->n_top );
/* Note page number of primary image.
*/
error = heif_context_get_primary_image_ID( heif->ctx, &primary_id );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
for( i = 0; i < heif->n_top; i++ )
if( heif->id[i] == primary_id )
heif->primary_page = i;
/* If @n and @page have not been set, @page defaults to the primary
* page.
*/
if( !vips_object_argument_isset( VIPS_OBJECT( load ), "page" ) &&
!vips_object_argument_isset( VIPS_OBJECT( load ), "n" ) )
heif->page = heif->primary_page;
if( heif->n == -1 )
heif->n = heif->n_top - heif->page;
if( heif->page < 0 ||
heif->n <= 0 ||
heif->page + heif->n > heif->n_top ) {
vips_error( class->nickname, "%s", _( "bad page number" ) );
return( -1 );
}
#ifdef DEBUG
for( i = heif->page; i < heif->page + heif->n; i++ ) {
heif_item_id thumb_ids[1];
int n_items;
int n_thumbs;
int j;
if( vips_foreign_load_heif_set_page( heif, i, FALSE ) )
return( -1 );
n_thumbs = heif_image_handle_get_number_of_thumbnails(
heif->handle );
n_items = heif_image_handle_get_list_of_thumbnail_IDs(
heif->handle, thumb_ids, 1 );
printf( "page = %d\n", i );
printf( "n_thumbs = %d\n", n_thumbs );
printf( "n_items = %d\n", n_items );
for( j = 0; j < n_items; j++ ) {
struct heif_image_handle *thumb_handle;
error = heif_image_handle_get_thumbnail( heif->handle,
thumb_ids[j], &thumb_handle );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
printf( " thumb %d\n", j );
printf( " width = %d\n",
heif_image_handle_get_width( thumb_handle ) );
printf( " height = %d\n",
heif_image_handle_get_height( thumb_handle ) );
}
}
#endif /*DEBUG*/
/* All pages must be the same size for libvips toilet roll images.
*/
if( vips_foreign_load_heif_set_page( heif, heif->page, heif->thumbnail ) )
return( -1 );
heif->page_width = heif_image_handle_get_width( heif->handle );
heif->page_height = heif_image_handle_get_height( heif->handle );
for( i = heif->page + 1; i < heif->page + heif->n; i++ ) {
if( vips_foreign_load_heif_set_page( heif,
i, heif->thumbnail ) )
return( -1 );
if( heif_image_handle_get_width( heif->handle ) !=
heif->page_width ||
heif_image_handle_get_height( heif->handle ) !=
heif->page_height ) {
vips_error( class->nickname, "%s",
_( "not all pages are the same size" ) );
return( -1 );
}
}
#ifdef DEBUG
printf( "n_top = %d\n", heif->n_top );
for( i = 0; i < heif->n_top; i++ ) {
printf( " id[%d] = %d\n", i, heif->id[i] );
if( vips_foreign_load_heif_set_page( heif, i, FALSE ) )
return( -1 );
printf( " width = %d\n",
heif_image_handle_get_width( heif->handle ) );
printf( " height = %d\n",
heif_image_handle_get_height( heif->handle ) );
printf( " depth = %d\n",
heif_image_handle_has_depth_image( heif->handle ) );
printf( " n_metadata = %d\n",
heif_image_handle_get_number_of_metadata_blocks(
heif->handle, NULL ) );
printf( " colour profile type = %d\n",
heif_image_handle_get_color_profile_type(
heif->handle ) );
}
#endif /*DEBUG*/
if( vips_foreign_load_heif_set_header( heif, load->out ) )
return( -1 );
return( 0 );
}
static int
vips_foreign_load_heif_generate( VipsRegion *or,
void *seq, void *a, void *b, gboolean *stop )
{
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) a;
VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( heif );
VipsRect *r = &or->valid;
int page = r->top / heif->page_height + heif->page;
int line = r->top % heif->page_height;
#ifdef DEBUG_VERBOSE
printf( "vips_foreign_load_heif_generate: line %d\n", r->top );
#endif /*DEBUG_VERBOSE*/
g_assert( r->height == 1 );
if( vips_foreign_load_heif_set_page( heif, page, heif->thumbnail ) )
return( -1 );
if( !heif->img ) {
struct heif_error error;
struct heif_decoding_options *options;
/* Decode the image to 24bit interleaved.
*
* FIXME What will this do for RGBA? Or is alpha always
* separate?
*/
options = heif_decoding_options_alloc();
options->ignore_transformations = !heif->autorotate;
error = heif_decode_image( heif->handle, &heif->img,
heif_colorspace_RGB, heif_chroma_interleaved_24bit,
options );
heif_decoding_options_free( options );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
}
if( !heif->data )
if( !(heif->data = heif_image_get_plane_readonly( heif->img,
heif_channel_interleaved, &heif->stride )) ) {
vips_error( class->nickname,
"%s", _( "unable to get image data" ) );
return( -1 );
}
memcpy( VIPS_REGION_ADDR( or, 0, r->top ),
heif->data + heif->stride * line,
VIPS_IMAGE_SIZEOF_LINE( or->im ) );
return( 0 );
}
static int
vips_foreign_load_heif_load( VipsForeignLoad *load )
{
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) load;
VipsImage **t = (VipsImage **)
vips_object_local_array( VIPS_OBJECT( load ), 3 );
#ifdef DEBUG
printf( "vips_foreign_load_heif_load: loading image\n" );
#endif /*DEBUG*/
t[0] = vips_image_new();
if( vips_foreign_load_heif_set_header( heif, t[0] ) )
return( -1 );
if( vips_image_generate( t[0],
NULL, vips_foreign_load_heif_generate, NULL, heif, NULL ) ||
vips_sequential( t[0], &t[1], NULL ) ||
vips_image_write( t[1], load->real ) )
return( -1 );
return( 0 );
}
static void
vips_foreign_load_heif_class_init( VipsForeignLoadHeifClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class;
gobject_class->dispose = vips_foreign_load_heif_dispose;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
object_class->nickname = "heifload_base";
object_class->description = _( "load a HEIF image" );
load_class->get_flags = vips_foreign_load_heif_get_flags;
load_class->header = vips_foreign_load_heif_header;
load_class->load = vips_foreign_load_heif_load;
VIPS_ARG_INT( class, "page", 2,
_( "Page" ),
_( "Load this page from the file" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignLoadHeif, page ),
0, 100000, 0 );
VIPS_ARG_INT( class, "n", 3,
_( "n" ),
_( "Load this many pages" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignLoadHeif, n ),
-1, 100000, 1 );
VIPS_ARG_BOOL( class, "autorotate", 4,
_( "Autorotate" ),
_( "Apply image transformations" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignLoadHeif, autorotate ),
FALSE );
VIPS_ARG_BOOL( class, "thumbnail", 4,
_( "Thumbnail" ),
_( "Fetch thumbnail image" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignLoadHeif, thumbnail ),
FALSE );
}
static void
vips_foreign_load_heif_init( VipsForeignLoadHeif *heif )
{
heif->ctx = heif_context_alloc();
heif->n = 1;
}
typedef struct _VipsForeignLoadHeifFile {
VipsForeignLoadHeif parent_object;
/* Filename for load.
*/
char *filename;
} VipsForeignLoadHeifFile;
typedef VipsForeignLoadHeifClass VipsForeignLoadHeifFileClass;
G_DEFINE_TYPE( VipsForeignLoadHeifFile, vips_foreign_load_heif_file,
vips_foreign_load_heif_get_type() );
static int
vips_foreign_load_heif_file_is_a( const char *filename )
{
char buf[12];
if( vips__get_bytes( filename, (unsigned char *) buf, 12 ) != 12 )
return( 0 );
return( vips_foreign_load_heif_is_a( buf, 12 ) );
}
static int
vips_foreign_load_heif_file_header( VipsForeignLoad *load )
{
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) load;
VipsForeignLoadHeifFile *file = (VipsForeignLoadHeifFile *) load;
struct heif_error error;
error = heif_context_read_from_file( heif->ctx, file->filename, NULL );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
if( VIPS_FOREIGN_LOAD_CLASS(
vips_foreign_load_heif_file_parent_class )->header( load ) )
return( -1 );
VIPS_SETSTR( load->out->filename, file->filename );
return( 0 );
}
const char *vips__heif_suffs[] = {
".heic",
NULL
};
static void
vips_foreign_load_heif_file_class_init( VipsForeignLoadHeifFileClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
object_class->nickname = "heifload";
foreign_class->suffs = vips__heif_suffs;
load_class->is_a = vips_foreign_load_heif_file_is_a;
load_class->header = vips_foreign_load_heif_file_header;
VIPS_ARG_STRING( class, "filename", 1,
_( "Filename" ),
_( "Filename to load from" ),
VIPS_ARGUMENT_REQUIRED_INPUT,
G_STRUCT_OFFSET( VipsForeignLoadHeifFile, filename ),
NULL );
}
static void
vips_foreign_load_heif_file_init( VipsForeignLoadHeifFile *file )
{
}
typedef struct _VipsForeignLoadHeifBuffer {
VipsForeignLoadHeif parent_object;
/* Load from a buffer.
*/
VipsArea *buf;
} VipsForeignLoadHeifBuffer;
typedef VipsForeignLoadHeifClass VipsForeignLoadHeifBufferClass;
G_DEFINE_TYPE( VipsForeignLoadHeifBuffer, vips_foreign_load_heif_buffer,
vips_foreign_load_heif_get_type() );
static gboolean
vips_foreign_load_heif_buffer_is_a( const void *buf, size_t len )
{
return( vips_foreign_load_heif_is_a( buf, len ) );
}
static int
vips_foreign_load_heif_buffer_header( VipsForeignLoad *load )
{
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) load;
VipsForeignLoadHeifBuffer *buffer = (VipsForeignLoadHeifBuffer *) load;
struct heif_error error;
error = heif_context_read_from_memory( heif->ctx,
buffer->buf->data, buffer->buf->length, NULL );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
if( VIPS_FOREIGN_LOAD_CLASS(
vips_foreign_load_heif_buffer_parent_class )->header( load ) )
return( -1 );
return( 0 );
}
static void
vips_foreign_load_heif_buffer_class_init(
VipsForeignLoadHeifBufferClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
object_class->nickname = "heifload_buffer";
load_class->is_a_buffer = vips_foreign_load_heif_buffer_is_a;
load_class->header = vips_foreign_load_heif_buffer_header;
VIPS_ARG_BOXED( class, "buffer", 1,
_( "Buffer" ),
_( "Buffer to load from" ),
VIPS_ARGUMENT_REQUIRED_INPUT,
G_STRUCT_OFFSET( VipsForeignLoadHeifBuffer, buf ),
VIPS_TYPE_BLOB );
}
static void
vips_foreign_load_heif_buffer_init( VipsForeignLoadHeifBuffer *buffer )
{
}
#endif /*HAVE_HEIF*/
/**
* vips_heifload:
* @filename: file to load
* @out: (out): decompressed image
* @...: %NULL-terminated list of optional named arguments
*
* Optional arguments:
*
* * @page: %gint, page (top-level image number) to read
* * @n: %gint, load this many pages
* * @autorotate: %gboolean, apply image transformations
*
* Read a HEIF image file into a VIPS image.
*
* Use @page to select a page to render, numbering from zero. If neither @n
* nor @page are set, @page defaults to the primary page, otherwise to 0.
*
* Use @n to select the number of pages to render. The default is 1. Pages are
* rendered in a vertical column. Set to -1 to mean "until the end of the
* document". Use vips_grid() to reorganise pages.
*
* HEIF images have a primary image. The metadata item `heif-primary` gives
* the page number of the primary.
*
* HEIF images can have trsnaformations like rotate, flip and crop stored in
* the header. Set @autorotate %TRUE to apply these during load.
*
* See also: vips_image_new_from_file().
*
* Returns: 0 on success, -1 on error.
*/
int
vips_heifload( const char *filename, VipsImage **out, ... )
{
va_list ap;
int result;
va_start( ap, out );
result = vips_call_split( "heifload", ap, filename, out );
va_end( ap );
return( result );
}
/**
* vips_heifload_buffer:
* @buf: (array length=len) (element-type guint8): memory area to load
* @len: (type gsize): size of memory area
* @out: (out): image to write
* @...: %NULL-terminated list of optional named arguments
*
* Optional arguments:
*
* * @page: %gint, page (top-level image number) to read
* * @n: %gint, load this many pages
* * @autorotate: %gboolean, apply image transformations
*
* Read a HEIF image file into a VIPS image.
* Exactly as
* vips_heifload(), but read from a memory buffer.
*
* You must not free the buffer while @out is active. The
* #VipsObject::postclose signal on @out is a good place to free.
*
* See also: vips_heifload().
*
* Returns: 0 on success, -1 on error.
*/
int
vips_heifload_buffer( void *buf, size_t len, VipsImage **out, ... )
{
va_list ap;
VipsBlob *blob;
int result;
/* We don't take a copy of the data or free it.
*/
blob = vips_blob_new( NULL, buf, len );
va_start( ap, out );
result = vips_call_split( "heifload_buffer", ap, blob, out );
va_end( ap );
vips_area_unref( VIPS_AREA( blob ) );
return( result );
}

651
libvips/foreign/heifsave.c Normal file
View File

@ -0,0 +1,651 @@
/* save to heif
*
* 5/7/18
* - from niftisave.c
*/
/*
This file is part of VIPS.
VIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
/*
#define DEBUG_VERBOSE
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vips/vips.h>
#include <vips/internal.h>
#ifdef HAVE_HEIF
#include <libheif/heif.h>
#include "pforeign.h"
typedef struct _VipsForeignSaveHeif {
VipsForeignSave parent_object;
/* Coding quality factor (1-100).
*/
int Q;
/* Lossless compression.
*/
gboolean lossless;
int page_width;
int page_height;
int n_pages;
struct heif_context *ctx;
struct heif_encoder *encoder;
/* The current page we are writing.
*/
struct heif_image_handle *handle;
/* The current page in memory which we build as we scan down the
* image.
*/
struct heif_image *img;
/* The libheif memory area will fill with pixels from the libvips
* pipe.
*/
uint8_t *data;
int stride;
} VipsForeignSaveHeif;
typedef VipsForeignSaveClass VipsForeignSaveHeifClass;
G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveHeif, vips_foreign_save_heif,
VIPS_TYPE_FOREIGN_SAVE );
static void
vips_foreign_save_heif_dispose( GObject *gobject )
{
VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) gobject;
VIPS_FREEF( heif_image_release, heif->img );
VIPS_FREEF( heif_image_handle_release, heif->handle );
VIPS_FREEF( heif_encoder_release, heif->encoder );
VIPS_FREEF( heif_context_free, heif->ctx );
G_OBJECT_CLASS( vips_foreign_save_heif_parent_class )->
dispose( gobject );
}
typedef struct heif_error (*libheif_metadata_fn)( struct heif_context *,
const struct heif_image_handle *,
const void *, int );
struct _VipsForeignSaveHeifMetadata {
const char *name;
libheif_metadata_fn saver;
} libheif_metadata[] = {
{ VIPS_META_EXIF_NAME, heif_context_add_exif_metadata },
{ VIPS_META_XMP_NAME, heif_context_add_XMP_metadata }
};
static int
vips_foreign_save_heif_write_metadata( VipsForeignSaveHeif *heif )
{
VipsForeignSave *save = (VipsForeignSave *) heif;
int i;
struct heif_error error;
for( i = 0; i < VIPS_NUMBER( libheif_metadata ); i++ )
if( vips_image_get_typeof( save->ready,
libheif_metadata[i].name ) ) {
const void *data;
size_t length;
#ifdef DEBUG
printf( "attaching %s ..\n",
libheif_metadata[i].name );
#endif /*DEBUG*/
if( vips_image_get_blob( save->ready,
VIPS_META_EXIF_NAME, &data, &length ) )
return( -1 );
error = libheif_metadata[i].saver( heif->ctx,
heif->handle, data, length );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
}
return( 0 );
}
static int
vips_foreign_save_heif_write_page( VipsForeignSaveHeif *heif, int page )
{
VipsForeignSave *save = (VipsForeignSave *) heif;
struct heif_error error;
struct heif_encoding_options *options;
if( !save->strip &&
vips_image_get_typeof( save->ready, VIPS_META_ICC_NAME ) ) {
const void *data;
size_t length;
#ifdef DEBUG
printf( "attaching profile ..\n" );
#endif /*DEBUG*/
if( vips_image_get_blob( save->ready,
VIPS_META_ICC_NAME, &data, &length ) )
return( -1 );
/* FIXME .. also see heif_image_set_nclx_color_profile()
*/
error = heif_image_set_raw_color_profile( heif->img,
"rICC", data, length );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
}
options = heif_encoding_options_alloc();
/* FIXME .. should be an option, though I don't know of any way to
* test it
*/
options->save_alpha_channel = 1;
#ifdef DEBUG
printf( "encoding ..\n" );
#endif /*DEBUG*/
error = heif_context_encode_image( heif->ctx,
heif->img, heif->encoder, NULL, &heif->handle );
heif_encoding_options_free( options );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
if( vips_image_get_typeof( save->ready, "heif-primary" ) ) {
int primary;
if( vips_image_get_int( save->ready,
"heif-primary", &primary ) )
return( -1 );
if( page == primary ) {
error = heif_context_set_primary_image( heif->ctx,
heif->handle );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
}
}
if( !save->strip &&
vips_foreign_save_heif_write_metadata( heif ) )
return( -1 );
VIPS_FREEF( heif_image_handle_release, heif->handle );
return( 0 );
}
static int
vips_foreign_save_heif_write_block( VipsRegion *region, VipsRect *area,
void *a )
{
VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) a;
int y;
#ifdef DEBUG
printf( "vips_foreign_save_heif_write_block: y = %d\n", area->top );
#endif /*DEBUG*/
/* Copy a line at a time into our output image, write each time the
* image fills.
*/
for( y = 0; y < area->height; y++ ) {
/* Y in page.
*/
int page = (area->top + y) / heif->page_height;
int line = (area->top + y) % heif->page_height;
VipsPel *p = VIPS_REGION_ADDR( region, 0, area->top + y );
VipsPel *q = heif->data + line * heif->stride;
memcpy( q, p, VIPS_IMAGE_SIZEOF_LINE( region->im ) );
/* Did we just write the final line? Write as a new page
* into the output.
*/
if( line == heif->page_height - 1 )
if( vips_foreign_save_heif_write_page( heif, page ) )
return( -1 );
}
return( 0 );
}
static int
vips_foreign_save_heif_build( VipsObject *object )
{
VipsForeignSave *save = (VipsForeignSave *) object;
VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object;
struct heif_error error;
if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_parent_class )->
build( object ) )
return( -1 );
/* TODO ... should be a param? the other useful one is AVC.
*/
error = heif_context_get_encoder_for_format( heif->ctx,
heif_compression_HEVC, &heif->encoder );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
error = heif_encoder_set_lossy_quality( heif->encoder, heif->Q );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
error = heif_encoder_set_lossless( heif->encoder, heif->lossless );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
/* TODO .. support extra per-encoder params with
* heif_encoder_list_parameters().
*/
heif->page_width = save->ready->Xsize;
if( vips_image_get_typeof( save->ready, VIPS_META_PAGE_HEIGHT ) ) {
if( vips_image_get_int( save->ready,
VIPS_META_PAGE_HEIGHT, &heif->page_height ) )
return( -1 );
}
else
heif->page_height = save->ready->Ysize;
if( heif->page_height == 0 ||
save->ready->Ysize % heif->page_height != 0 )
heif->page_height = save->ready->Ysize;
heif->n_pages = save->ready->Ysize / heif->page_height;
/* Make a heif image the size of a page. We repeatedly fill this with
* sink_disc() and write a frame each time it fills.
*/
error = heif_image_create( heif->page_width, heif->page_height,
heif_colorspace_RGB, heif_chroma_interleaved_RGB, &heif->img );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
error = heif_image_add_plane( heif->img, heif_channel_interleaved,
heif->page_width, heif->page_height, 24 );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
heif->data = heif_image_get_plane( heif->img,
heif_channel_interleaved, &heif->stride );
/* Just do this once, so we don't rebuild exif on every page.
*/
if( vips_image_get_typeof( save->ready, VIPS_META_EXIF_NAME ) )
if( vips__exif_update( save->ready ) )
return( -1 );
/* Write data.
*/
if( vips_sink_disc( save->ready,
vips_foreign_save_heif_write_block, heif ) )
return( -1 );
return( 0 );
}
/* Save a bit of typing.
*/
#define UC VIPS_FORMAT_UCHAR
static int vips_heif_bandfmt[10] = {
/* UC C US S UI I F X D DX */
UC, UC, UC, UC, UC, UC, UC, UC, UC, UC
};
static void
vips_foreign_save_heif_class_init( VipsForeignSaveHeifClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class;
gobject_class->dispose = vips_foreign_save_heif_dispose;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
object_class->nickname = "heifsave";
object_class->description = _( "save image in HEIF format" );
object_class->build = vips_foreign_save_heif_build;
foreign_class->suffs = vips__heif_suffs;
save_class->saveable = VIPS_SAVEABLE_RGB;
save_class->format_table = vips_heif_bandfmt;
VIPS_ARG_INT( class, "Q", 10,
_( "Q" ),
_( "Q factor" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSaveHeif, Q ),
1, 100, 50 );
VIPS_ARG_BOOL( class, "lossless", 13,
_( "Lossless" ),
_( "Enable lossless compression" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSaveHeif, lossless ),
FALSE );
}
static void
vips_foreign_save_heif_init( VipsForeignSaveHeif *heif )
{
heif->ctx = heif_context_alloc();
heif->Q = 50;
}
typedef struct _VipsForeignSaveHeifFile {
VipsForeignSaveHeif parent_object;
/* Filename for save.
*/
char *filename;
} VipsForeignSaveHeifFile;
typedef VipsForeignSaveHeifClass VipsForeignSaveHeifFileClass;
G_DEFINE_TYPE( VipsForeignSaveHeifFile, vips_foreign_save_heif_file,
vips_foreign_save_heif_get_type() );
static int
vips_foreign_save_heif_file_build( VipsObject *object )
{
VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object;
VipsForeignSaveHeifFile *file = (VipsForeignSaveHeifFile *) object;
struct heif_error error;
if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_file_parent_class )->
build( object ) )
return( -1 );
/* This has to come right at the end :-( so there's no support for
* incremental writes.
*/
error = heif_context_write_to_file( heif->ctx, file->filename );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
return( 0 );
}
static void
vips_foreign_save_heif_file_class_init( VipsForeignSaveHeifFileClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
object_class->nickname = "heifsave";
object_class->build = vips_foreign_save_heif_file_build;
VIPS_ARG_STRING( class, "filename", 1,
_( "Filename" ),
_( "Filename to load from" ),
VIPS_ARGUMENT_REQUIRED_INPUT,
G_STRUCT_OFFSET( VipsForeignSaveHeifFile, filename ),
NULL );
}
static void
vips_foreign_save_heif_file_init( VipsForeignSaveHeifFile *file )
{
}
typedef struct _VipsForeignSaveHeifBuffer {
VipsForeignSaveHeif parent_object;
/* Save to a buffer.
*/
VipsArea *buf;
} VipsForeignSaveHeifBuffer;
typedef VipsForeignSaveHeifClass VipsForeignSaveHeifBufferClass;
G_DEFINE_TYPE( VipsForeignSaveHeifBuffer, vips_foreign_save_heif_buffer,
vips_foreign_save_heif_get_type() );
struct heif_error
vips_foreign_save_heif_buffer_write( struct heif_context *ctx,
const void *data, size_t length, void *userdata )
{
VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) userdata;
VipsBlob *blob;
struct heif_error error;
void *data_copy;
/* FIXME .. we have to memcpy()!
*/
data_copy = vips_malloc( NULL, length );
memcpy( data_copy, data, length );
blob = vips_blob_new( (VipsCallbackFn) vips_free, data_copy, length );
g_object_set( heif, "buffer", blob, NULL );
vips_area_unref( VIPS_AREA( blob ) );
error.code = 0;
return( error );
}
static int
vips_foreign_save_heif_buffer_build( VipsObject *object )
{
VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object;
/* FIXME ... argh, allocating on the stack! But the example code does
* this too.
*/
struct heif_writer writer;
struct heif_error error;
if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_buffer_parent_class )->
build( object ) )
return( -1 );
/* This has to come right at the end :-( so there's no support for
* incremental writes.
*/
writer.writer_api_version = 1;
writer.write = vips_foreign_save_heif_buffer_write;
error = heif_context_write( heif->ctx, &writer, heif );
if( error.code ) {
vips__heif_error( &error );
return( -1 );
}
return( 0 );
}
static void
vips_foreign_save_heif_buffer_class_init(
VipsForeignSaveHeifBufferClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
object_class->nickname = "heifsave_buffer";
object_class->build = vips_foreign_save_heif_buffer_build;
VIPS_ARG_BOXED( class, "buffer", 1,
_( "Buffer" ),
_( "Buffer to save to" ),
VIPS_ARGUMENT_REQUIRED_OUTPUT,
G_STRUCT_OFFSET( VipsForeignSaveHeifBuffer, buf ),
VIPS_TYPE_BLOB );
}
static void
vips_foreign_save_heif_buffer_init( VipsForeignSaveHeifBuffer *buffer )
{
}
#endif /*HAVE_HEIF*/
/**
* vips_heifsave: (method)
* @in: image to save
* @filename: file to write to
* @...: %NULL-terminated list of optional named arguments
*
* Optional arguments:
*
* * @Q: %gint, quality factor
* * @lossless: %gboolean, enable lossless encoding
*
* Write a VIPS image to a file in HEIF format.
*
* Use @Q to set the compression factor. Default 50, which seems to be roughly
* what the iphone uses. Q 30 gives about the same quality as JPEG Q 75.
*
* Set @lossless %TRUE to switch to lossless compression.
*
* See also: vips_image_write_to_file(), vips_heifload().
*
* Returns: 0 on success, -1 on error.
*/
int
vips_heifsave( VipsImage *in, const char *filename, ... )
{
va_list ap;
int result;
va_start( ap, filename );
result = vips_call_split( "heifsave", ap, in, filename );
va_end( ap );
return( result );
}
/**
* vips_heifsave_buffer: (method)
* @in: image to save
* @buf: (array length=len) (element-type guint8): return output buffer here
* @len: (type gsize): return output length here
* @...: %NULL-terminated list of optional named arguments
*
* Optional arguments:
*
* * @Q: %gint, quality factor
* * @lossless: %gboolean, enable lossless encoding
*
* As vips_heifsave(), but save to a memory buffer.
*
* The address of the buffer is returned in @obuf, the length of the buffer in
* @olen. You are responsible for freeing the buffer with g_free() when you
* are done with it.
*
* See also: vips_heifsave(), vips_image_write_to_file().
*
* Returns: 0 on success, -1 on error.
*/
int
vips_heifsave_buffer( VipsImage *in, void **buf, size_t *len, ... )
{
va_list ap;
VipsArea *area;
int result;
area = NULL;
va_start( ap, len );
result = vips_call_split( "heifsave_buffer", ap, in, &area );
va_end( ap );
if( !result &&
area ) {
if( buf ) {
*buf = area->data;
area->free_fn = NULL;
}
if( len )
*len = area->length;
vips_area_unref( area );
}
return( result );
}

View File

@ -565,7 +565,7 @@ vips_foreign_load_nifti_load( VipsForeignLoad *load )
load->out->Bands, load->out->BandFmt )) )
return( -1 );
if( vips_copy( nifti->memory, &load->real, NULL ) )
if( vips_image_write( nifti->memory, load->real ) )
return( -1 );
return( 0 );
@ -617,7 +617,7 @@ vips_foreign_load_nifti_init( VipsForeignLoadNifti *nifti )
{
}
#endif /*HAVE_CFITSIO*/
#endif /*HAVE_NIFTI*/
/**
* vips_niftiload:

View File

@ -272,6 +272,10 @@ typedef void *(*VipsNiftiMapFn)( const char *name, GValue *value, glong offset,
void *a, void *b );
void *vips__foreign_nifti_map( VipsNiftiMapFn fn, void *a, void *b );
extern const char *vips__heif_suffs[];
struct heif_error;
void vips__heif_error( struct heif_error *error );
#ifdef __cplusplus
}
#endif /*__cplusplus*/

View File

@ -560,6 +560,15 @@ int vips_gifload( const char *filename, VipsImage **out, ... )
int vips_gifload_buffer( void *buf, size_t len, VipsImage **out, ... )
__attribute__((sentinel));
int vips_heifload( const char *filename, VipsImage **out, ... )
__attribute__((sentinel));
int vips_heifload_buffer( void *buf, size_t len, VipsImage **out, ... )
__attribute__((sentinel));
int vips_heifsave( VipsImage *in, const char *filename, ... )
__attribute__((sentinel));
int vips_heifsave_buffer( VipsImage *in, void **buf, size_t *len, ... )
__attribute__((sentinel));
int vips_niftiload( const char *filename, VipsImage **out, ... )
__attribute__((sentinel));
int vips_niftisave( VipsImage *in, const char *filename, ... )

View File

@ -115,6 +115,11 @@ typedef struct _VipsThumbnail {
*/
int n_pages;
/* For HEIF, try to fetch the size of the stored thumbnail.
*/
int heif_thumbnail_width;
int heif_thumbnail_height;
} VipsThumbnail;
typedef struct _VipsThumbnailClass {
@ -264,6 +269,28 @@ vips_thumbnail_get_tiff_pyramid( VipsThumbnail *thumbnail )
thumbnail->level_count = thumbnail->n_pages;
}
/* This may not be a pyr tiff, so no error if we can't find the layers.
*/
static int
vips_thumbnail_get_heif_thumb_info( VipsThumbnail *thumbnail )
{
VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS( thumbnail );
VipsImage *thumb;
if( !(thumb = class->open( thumbnail, 1 )) )
return( -1 );
if( thumb->Xsize < thumbnail->input_width ) {
thumbnail->heif_thumbnail_width = thumb->Xsize;
thumbnail->heif_thumbnail_height = thumb->Ysize;
}
VIPS_UNREF( thumb );
return( 0 );
}
/* Calculate the shrink factor, taking into account auto-rotate, the fit mode,
* and so on.
*
@ -420,6 +447,12 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) )
vips_thumbnail_get_tiff_pyramid( thumbnail );
/* For heif, we need to fetch the thumbnail size, in case we can use
* that as the source.
*/
if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) )
vips_thumbnail_get_heif_thumb_info( thumbnail );
factor = 1.0;
if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) ) {
@ -452,6 +485,19 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
g_info( "loading webp with factor %g pre-shrink", factor );
}
else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) {
/* 'factor' is a gboolean which enables thumbnail load instead
* of image load.
*
* Use the thumbnail if it's larger than our target.
*/
if( thumbnail->heif_thumbnail_width >= thumbnail->width &&
thumbnail->heif_thumbnail_height >= thumbnail->height )
factor = 1.0;
else
factor = 0.0;
}
if( !(im = class->open( thumbnail, factor )) )
return( NULL );
@ -866,6 +912,12 @@ vips_thumbnail_file_open( VipsThumbnail *thumbnail, double factor )
"page", (int) factor,
NULL ) );
}
else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) {
return( vips_image_new_from_file( file->filename,
"access", VIPS_ACCESS_SEQUENTIAL,
"thumbnail", (int) factor,
NULL ) );
}
else {
return( vips_image_new_from_file( file->filename,
"access", VIPS_ACCESS_SEQUENTIAL,
@ -1055,6 +1107,13 @@ vips_thumbnail_buffer_open( VipsThumbnail *thumbnail, double factor )
"page", (int) factor,
NULL ) );
}
else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) {
return( vips_image_new_from_buffer(
buffer->buf->data, buffer->buf->length, "",
"access", VIPS_ACCESS_SEQUENTIAL,
"thumbnail", (int) factor,
NULL ) );
}
else {
return( vips_image_new_from_buffer(
buffer->buf->data, buffer->buf->length, buffer->option_string,

View File

@ -29,6 +29,7 @@ DICOM_FILE = os.path.join(IMAGES, "dicom_test_image.dcm")
BMP_FILE = os.path.join(IMAGES, "MARBLES.BMP")
NIFTI_FILE = os.path.join(IMAGES, "avg152T1_LR_nifti.nii.gz")
ICO_FILE = os.path.join(IMAGES, "favicon.ico")
HEIC_FILE = os.path.join(IMAGES, "Example1.heic")
unsigned_formats = [pyvips.BandFormat.UCHAR,
pyvips.BandFormat.USHORT,

Binary file not shown.

View File

@ -11,7 +11,7 @@ from helpers import \
JPEG_FILE, SRGB_FILE, MATLAB_FILE, PNG_FILE, TIF_FILE, OME_FILE, \
ANALYZE_FILE, GIF_FILE, WEBP_FILE, EXR_FILE, FITS_FILE, OPENSLIDE_FILE, \
PDF_FILE, SVG_FILE, SVGZ_FILE, SVG_GZ_FILE, GIF_ANIM_FILE, DICOM_FILE, \
BMP_FILE, NIFTI_FILE, ICO_FILE, \
BMP_FILE, NIFTI_FILE, ICO_FILE, HEIC_FILE, \
temp_filename, assert_almost_equal_objects, have, skip_if_no
@ -577,13 +577,6 @@ class TestForeign:
assert im.height == 9919
assert im.bands == 1
print("NIFTI_FILE =", NIFTI_FILE)
im = pyvips.Operation.call("niftiload", NIFTI_FILE)
print("width = ", im.width)
im = pyvips.Operation.call("niftiload", "test/images/avg152T1_LR_nifti.nii.gz")
print("width = ", im.width)
self.file_loader("niftiload", NIFTI_FILE, nifti_valid)
self.save_load("%s.nii.gz", self.mono)
@ -838,5 +831,53 @@ class TestForeign:
buf = self.colour.dzsave_buffer(region_shrink="mode")
buf = self.colour.dzsave_buffer(region_shrink="median")
@skip_if_no("heifload")
def test_heifload(self):
def heif_valid(im):
a = im(10, 10)
assert_almost_equal_objects(a, [75.0, 86.0, 81.0])
assert im.width == 4032
assert im.height == 3024
assert im.bands == 3
self.file_loader("heifload", HEIC_FILE, heif_valid)
self.buffer_loader("heifload_buffer", HEIC_FILE, heif_valid)
self.save_load_buffer("heifsave_buffer", "heifload_buffer",
self.colour, 70)
self.save_load("%s.heic", self.colour)
# test lossless mode
im = pyvips.Image.new_from_file(HEIC_FILE)
buf = im.heifsave_buffer(lossless=True)
im2 = pyvips.Image.new_from_buffer(buf, "")
# not in fact quite lossless
assert abs(im.avg() - im2.avg()) < 3
# higher Q should mean a bigger buffer
b1 = im.heifsave_buffer(Q=10)
b2 = im.heifsave_buffer(Q=90)
assert len(b2) > len(b1)
# try saving an image with an ICC profile and reading it back
buf = self.colour.heifsave_buffer()
im = pyvips.Image.new_from_buffer(buf, "")
p1 = self.colour.get("icc-profile-data")
p2 = im.get("icc-profile-data")
assert p1 == p2
# add tests for exif, xmp, ipct
# the exif test will need us to be able to walk the header,
# we can't just check exif-data
# test that exif changes change the output of heifsave
# first make sure we have exif support
z = pyvips.Image.new_from_file(JPEG_FILE)
if z.get_typeof("exif-ifd0-Orientation") != 0:
x = self.colour.copy()
x.set("orientation", 6)
buf = x.heifsave_buffer()
y = pyvips.Image.new_from_buffer(buf, "")
assert y.get("orientation") == 6
if __name__ == '__main__':
pytest.main()