AC_SUBST(PDF_CFLAGS)
AC_SUBST(PDF_LIBS)
+# Heif support
+# ----------------------------------------------------------------------
+
+AC_ARG_ENABLE([heif],
+ AC_HELP_STRING([--disable-heif], [disable heif support]),
+ [libheif=$enableval], [libheif=auto])
+
+if test "x${libheif}" != "xno"; then
+ PKG_CHECK_MODULES(HEIF, libheif >= 1.3.2,
+ [
+ HAVE_HEIF=yes
+ AC_DEFINE(HAVE_HEIF, 1, [define to enable heif support])
+ ],
+ [
+ HAVE_HEIF=no
+ AC_MSG_WARN([$HEIF_PKG_ERRORS])
+ ])
+else
+ HAVE_HEIF=disabled
+fi
+
+AM_CONDITIONAL(HAVE_HEIF, [test "x$HAVE_HEIF" = xyes])
+AC_SUBST(HEIF_CFLAGS)
+AC_SUBST(HEIF_LIBS)
+
# Markdown support
# ----------------------------------------------------------------------
Lua: $HAVE_LUA
FFmpegthumbnailer: $HAVE_FFMPEGTHUMBNAILER
Pdf: $HAVE_PDF
+ Heif: $HAVE_HEIF
Documentation:
Doxygen: $DX_DOXYGEN
<?xml version="1.0" encoding="utf-8"?>\r
<section id="GuideReferenceSupportedFormats">\r
<title id="titleGuideReferenceSupportedFormats">Supported File Formats</title>\r
- <para>3FR, ANI, APM, ARW, BMP, CR2, CRW, CUR, DDS, DNG, ERF, GIF, ICNS, ICO, JPE/JPEG/JPG, JPS, KDC, MEF, MPO, MOS, MRW, NEF, ORF, PEF, PTX, PBM/PGM/PNM/PPM, PNG, QIF/QTIF (QuickTime Image Format), RAF, RAW, RW2, SR2, SRF, SVG/SVGZ, TGA/TARGA, TIF/TIFF, WMF, XBM, XPM. Animated GIFs are supported.</para>\r
+ <para>3FR, ANI, APM, ARW, BMP, CR2, CRW, CUR, DDS, DNG, ERF, GIF, ICNS, ICO, JPE/JPEG/JPG, JPS, KDC, MEF, MPO, MOS, MRW, NEF, ORF, PEF, PTX, PBM/PGM/PNM/PPM, PNG, QIF/QTIF (QuickTime Image Format), RAF, RAW, RW2, SR2, SRF, SVG/SVGZ, TGA/TARGA, TIF/TIFF, WMF, XBM, XPM, HEIF (primary image only). Animated GIFs are supported.</para>\r
<para>\r
Refer to\r
<link linkend="GuideReferencePixbufLoaders" endterm="titleGuideReferencePixbufLoaders" />\r
$(CLUTTER_GTK_CFLAGS) \
$(FFMPEGTHUMBNAILER_CFLAGS) \
$(PDF_CFLAGS) \
+ $(HEIF_CFLAGS) \
-I$(top_srcdir) \
-I$(top_builddir)
$(CLUTTER_GTK_CFLAGS) \
$(FFMPEGTHUMBNAILER_CFLAGS) \
$(PDF_CFLAGS) \
+ $(HEIF_CFLAGS) \
-I$(top_srcdir) \
-I$(top_builddir)
image_load_collection.h\
image_load_pdf.c\
image_load_pdf.h\
+ image_load_heif.c\
+ image_load_heif.h\
image_load_ffmpegthumbnailer.c\
image_load_ffmpegthumbnailer.h\
image-overlay.c \
zonedetect.c \
zonedetect.h
-geeqie_LDADD = $(GTK_LIBS) $(GLIB_LIBS) $(INTLLIBS) $(JPEG_LIBS) $(TIFF_LIBS) $(LCMS_LIBS) $(EXIV2_LIBS) $(LIBCHAMPLAIN_LIBS) $(LIBCHAMPLAIN_GTK_LIBS) $(LUA_LIBS) $(CLUTTER_LIBS) $(CLUTTER_GTK_LIBS) $(FFMPEGTHUMBNAILER_LIBS) $(PDF_LIBS)
+geeqie_LDADD = $(GTK_LIBS) $(GLIB_LIBS) $(INTLLIBS) $(JPEG_LIBS) $(TIFF_LIBS) $(LCMS_LIBS) $(EXIV2_LIBS) $(LIBCHAMPLAIN_LIBS) $(LIBCHAMPLAIN_GTK_LIBS) $(LUA_LIBS) $(CLUTTER_LIBS) $(CLUTTER_GTK_LIBS) $(FFMPEGTHUMBNAILER_LIBS) $(PDF_LIBS) $(HEIF_LIBS)
EXTRA_DIST = \
$(extra_SLIK)
gq-marshal.c: gq-marshal.list gq-marshal.h
(echo "#include \"gq-marshal.h\"" ; $(GLIB_GENMARSHAL) --prefix=gq_marshal $(srcdir)/gq-marshal.list --body ) >$@
-
-
-
/* other supported formats */
filter_add_if_missing("dds", "DirectDraw Surface", ".dds", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
filter_add_if_missing("pdf", "Portable Document Format", ".pdf", FORMAT_CLASS_PDF, FALSE, FALSE, TRUE);
+ filter_add_if_missing("HEIF", "HEIF Format", ".heic", FORMAT_CLASS_HEIF, FALSE, FALSE, TRUE);
}
GList *filter_to_list(const gchar *extensions)
if (filter_file_class(name, FORMAT_CLASS_VIDEO)) return FORMAT_CLASS_VIDEO;
if (filter_file_class(name, FORMAT_CLASS_COLLECTION)) return FORMAT_CLASS_COLLECTION;
if (filter_file_class(name, FORMAT_CLASS_PDF)) return FORMAT_CLASS_PDF;
+ if (filter_file_class(name, FORMAT_CLASS_HEIF)) return FORMAT_CLASS_HEIF;
return FORMAT_CLASS_UNKNOWN;
}
icon_mirror.png \
icon_flip.png \
icon_original.png \
- icon_trash.png
+ icon_trash.png \
+ icon_heic.png
ICONS_INLINE_PAIRS = \
folder_closed $(srcdir)/folder_closed.png \
icon_mirror $(srcdir)/icon_mirror.png \
icon_flip $(srcdir)/icon_flip.png \
icon_original $(srcdir)/icon_original.png \
- icon_trash $(srcdir)/icon_trash.png
+ icon_trash $(srcdir)/icon_trash.png \
+ icon_heic $(srcdir)/icon_heic.png
icons_inline.h: $(ICONS_INLINE) Makefile.in
@sh -ec "echo '/* Auto generated file, do not edit */'; echo; \
#include "image_load_tiff.h"
#include "image_load_dds.h"
#include "image_load_pdf.h"
+#include "image_load_heif.h"
#include "image_load_ffmpegthumbnailer.h"
#include "image_load_collection.h"
}
else
#endif
+#ifdef HAVE_HEIF
+ if (il->fd->format_class == FORMAT_CLASS_HEIF)
+ {
+ DEBUG_1("Using custom heif loader");
+ image_loader_backend_set_heif(&il->backend);
+ }
+ else
+#endif
#ifdef HAVE_JPEG
if (il->bytes_total >= 2 && il->mapped_file[0] == 0xff && il->mapped_file[1] == 0xd8)
{
case FORMAT_CLASS_PDF:
pixbuf = pixbuf_inline(PIXBUF_INLINE_ICON_PDF);
break;
+ case FORMAT_CLASS_HEIF:
+ pixbuf = pixbuf_inline(PIXBUF_INLINE_ICON_HEIF);
+ break;
default:
pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN);
}
--- /dev/null
+/*
+ * Copyright (C) 20019 - The Geeqie Team
+ *
+ * Author: Colin Clark
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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.
+ */
+
+#include "main.h"
+
+#include "image-load.h"
+#include "image_load_heif.h"
+
+#ifdef HAVE_HEIF
+#include <libheif/heif.h>
+
+typedef struct _ImageLoaderHEIF ImageLoaderHEIF;
+struct _ImageLoaderHEIF {
+ ImageLoaderBackendCbAreaUpdated area_updated_cb;
+ ImageLoaderBackendCbSize size_cb;
+ ImageLoaderBackendCbAreaPrepared area_prepared_cb;
+ gpointer data;
+ GdkPixbuf *pixbuf;
+ guint requested_width;
+ guint requested_height;
+ gboolean abort;
+};
+
+static void free_buffer(guchar *pixels, gpointer data)
+{
+ g_free (pixels);
+}
+
+static gboolean image_loader_heif_load(gpointer loader, const guchar *buf, gsize count, GError **error)
+{
+ ImageLoaderHEIF *ld = (ImageLoaderHEIF *) loader;
+ struct heif_context* ctx;
+ struct heif_image* img;
+ struct heif_error error_code;
+ struct heif_image_handle* handle;
+ guint8* data;
+ gint width, height;
+ gint stride;
+ gboolean alpha;
+
+ ctx = heif_context_alloc();
+
+ error_code = heif_context_read_from_memory_without_copy(ctx, buf, count, NULL);
+ if (error_code.code)
+ {
+ log_printf("warning: heif reader error: %s\n", error_code.message);
+ heif_context_free(ctx);
+ return FALSE;
+ }
+
+ // get a handle to the primary image
+ error_code = heif_context_get_primary_image_handle(ctx, &handle);
+ if (error_code.code)
+ {
+ log_printf("warning: heif reader error: %s\n", error_code.message);
+ heif_context_free(ctx);
+ return FALSE;
+ }
+
+ // decode the image and convert colorspace to RGB, saved as 24bit interleaved
+ error_code = heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_24bit, NULL);
+ if (error_code.code)
+ {
+ log_printf("warning: heif reader error: %s\n", error_code.message);
+ heif_context_free(ctx);
+ return FALSE;
+ }
+
+ data = heif_image_get_plane(img, heif_channel_interleaved, &stride);
+
+ height = heif_image_get_height(img,heif_channel_interleaved);
+ width = heif_image_get_width(img,heif_channel_interleaved);
+ alpha = heif_image_handle_has_alpha_channel(handle);
+
+ ld->pixbuf = gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, alpha, 8, width, height, stride, free_buffer, NULL);
+
+ ld->area_updated_cb(loader, 0, 0, width, height, ld->data);
+
+ heif_context_free(ctx);
+
+ return TRUE;
+}
+
+static gpointer image_loader_heif_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
+{
+ ImageLoaderHEIF *loader = g_new0(ImageLoaderHEIF, 1);
+ loader->area_updated_cb = area_updated_cb;
+ loader->size_cb = size_cb;
+ loader->area_prepared_cb = area_prepared_cb;
+ loader->data = data;
+ return (gpointer) loader;
+}
+
+static void image_loader_heif_set_size(gpointer loader, int width, int height)
+{
+ ImageLoaderHEIF *ld = (ImageLoaderHEIF *) loader;
+ ld->requested_width = width;
+ ld->requested_height = height;
+}
+
+static GdkPixbuf* image_loader_heif_get_pixbuf(gpointer loader)
+{
+ ImageLoaderHEIF *ld = (ImageLoaderHEIF *) loader;
+ return ld->pixbuf;
+}
+
+static gchar* image_loader_heif_get_format_name(gpointer loader)
+{
+ return g_strdup("heif");
+}
+
+static gchar** image_loader_heif_get_format_mime_types(gpointer loader)
+{
+ static gchar *mime[] = {"image/heic", NULL};
+ return g_strdupv(mime);
+}
+
+static gboolean image_loader_heif_close(gpointer loader, GError **error)
+{
+ return TRUE;
+}
+
+static void image_loader_heif_abort(gpointer loader)
+{
+ ImageLoaderHEIF *ld = (ImageLoaderHEIF *) loader;
+ ld->abort = TRUE;
+}
+
+static void image_loader_heif_free(gpointer loader)
+{
+ ImageLoaderHEIF *ld = (ImageLoaderHEIF *) loader;
+ if (ld->pixbuf) g_object_unref(ld->pixbuf);
+ g_free(ld);
+}
+
+void image_loader_backend_set_heif(ImageLoaderBackend *funcs)
+{
+ funcs->loader_new = image_loader_heif_new;
+ funcs->set_size = image_loader_heif_set_size;
+ funcs->load = image_loader_heif_load;
+ funcs->write = NULL;
+ funcs->get_pixbuf = image_loader_heif_get_pixbuf;
+ funcs->close = image_loader_heif_close;
+ funcs->abort = image_loader_heif_abort;
+ funcs->free = image_loader_heif_free;
+ funcs->get_format_name = image_loader_heif_get_format_name;
+ funcs->get_format_mime_types = image_loader_heif_get_format_mime_types;
+}
+
+#endif
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
--- /dev/null
+/*
+ * Copyright (C) 20019 - The Geeqie Team
+ *
+ * Author: Colin Clark
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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.
+ */
+
+#ifndef IMAGE_LOAD_HEIF_H
+#define IMAGE_LOAD_HEIF_H
+
+#ifdef HAVE_HEIF
+void image_loader_backend_set_heif(ImageLoaderBackend *funcs);
+#endif
+
+#endif
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
{ PIXBUF_INLINE_ICON_FLIP, icon_flip },
{ PIXBUF_INLINE_ICON_ORIGINAL, icon_original },
{ PIXBUF_INLINE_ICON_TRASH, icon_trash },
+ { PIXBUF_INLINE_ICON_HEIF, icon_heic },
{ NULL, NULL }
};
case FORMAT_CLASS_PDF:
pixbuf = pixbuf_inline(PIXBUF_INLINE_ICON_PDF);
break;
+ case FORMAT_CLASS_HEIF:
+ pixbuf = pixbuf_inline(PIXBUF_INLINE_ICON_HEIF);
+ break;
default:
pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN);
}
#define PIXBUF_INLINE_ICON_SELECT_RECTANGLE "icon_select_rectangle"
#define PIXBUF_INLINE_ICON_FILE_FILTER "icon_file_filter"
#define PIXBUF_INLINE_ICON_TRASH "icon_trash"
+#define PIXBUF_INLINE_ICON_HEIF "icon_heic"
#define PIXBUF_INLINE_ICON_CW "icon_rotate_clockwise"
#define PIXBUF_INLINE_ICON_CCW "icon_rotate_counter_clockwise"
N_("Metadata"),
N_("Video"),
N_("Collection"),
- N_("Pdf")
+ N_("Pdf"),
+ N_("HEIF")
};
/* config memory values */
case FORMAT_CLASS_PDF:
out_string = g_string_append(out_string, " Class: PDF");
break;
+ case FORMAT_CLASS_HEIF:
+ out_string = g_string_append(out_string, " Class: HEIF");
+ break;
case FORMAT_CLASS_UNKNOWN:
out_string = g_string_append(out_string, " Class: Unknown");
break;
{
search_class = FORMAT_CLASS_RAWIMAGE;
}
+ else if (g_strcmp0(gtk_combo_box_text_get_active_text(
+ GTK_COMBO_BOX_TEXT(sd->class_type)), _("HEIF")) == 0)
+ {
+ search_class = FORMAT_CLASS_HEIF;
+ }
else if (g_strcmp0(gtk_combo_box_text_get_active_text(
GTK_COMBO_BOX_TEXT(sd->class_type)), _("Video")) == 0)
{
sd->class_type = gtk_combo_box_text_new();
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sd->class_type), _("Image"));
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sd->class_type), _("Raw Image"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sd->class_type), _("HEIF"));
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sd->class_type), _("Video"));
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sd->class_type), _("Metadata"));
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sd->class_type), _("Unknown"));
if (!tl->fd) tl->fd = file_data_ref(fd);
- if (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE && tl->fd->format_class != FORMAT_CLASS_COLLECTION && tl->fd->format_class != FORMAT_CLASS_VIDEO && tl->fd->format_class != FORMAT_CLASS_PDF && !options->file_filter.disable)
+ if (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE && tl->fd->format_class != FORMAT_CLASS_COLLECTION && tl->fd->format_class != FORMAT_CLASS_VIDEO && tl->fd->format_class != FORMAT_CLASS_PDF && tl->fd->format_class != FORMAT_CLASS_HEIF && !options->file_filter.disable)
{
thumb_loader_set_fallback(tl);
return FALSE;
tl->fd = file_data_ref(fd);
- if (!stat_utf8(fd->path, &st) || (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE && tl->fd->format_class != FORMAT_CLASS_VIDEO && tl->fd->format_class != FORMAT_CLASS_COLLECTION && tl->fd->format_class != FORMAT_CLASS_PDF && !options->file_filter.disable))
+ if (!stat_utf8(fd->path, &st) || (tl->fd->format_class != FORMAT_CLASS_IMAGE && tl->fd->format_class != FORMAT_CLASS_RAWIMAGE && tl->fd->format_class != FORMAT_CLASS_VIDEO && tl->fd->format_class != FORMAT_CLASS_COLLECTION && tl->fd->format_class != FORMAT_CLASS_PDF && tl->fd->format_class != FORMAT_CLASS_HEIF && !options->file_filter.disable))
{
thumb_loader_std_set_fallback(tl);
return FALSE;
FORMAT_CLASS_VIDEO,
FORMAT_CLASS_COLLECTION,
FORMAT_CLASS_PDF,
+ FORMAT_CLASS_HEIF,
FILE_FORMAT_CLASSES
} FileFormatClass;
#!/bin/bash
-version="2018-10-23"
+version="2019-07-03"
description=$'
Geeqie is an image viewer.
This script will download, compile, and install Geeqie on Debian-based systems.
"libffmpegthumbnailer-dev"
"libtiff (for tiff support)"
"libtiff-dev"
-"libjpeg (for jpeg support"
+"libjpeg (for jpeg support)"
"libjpeg-dev"
-"librsvg2 (for viewing .svg images"
+"librsvg2 (for viewing .svg images)"
"librsvg2-common"
"libwmf (for viewing .wmf images)"
"libwmf0.2-7-gtk"
"gphoto2"
"libimage-exiftool-perl (for jpeg extraction plugin)"
"libimage-exiftool-perl"
+"libheif (for HEIF support)"
+"libheif-dev"
)
# Optional for GTK3 only