yes | sudo apt-get install libraw-dev libomp-dev
yes | sudo apt-get install libunwind-dev
yes | sudo apt-get install libwebp-dev
- yes | sudo apt-get install webp-pixbuf-loader
yes | sudo apt-get install gettext
yes | sudo apt-get install git
yes | sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-build
yes | sudo apt-get install yelp-tools
mkdir -p $GITHUB_WORKSPACE/AppDir
mkdir -p $GITHUB_WORKSPACE/AppDir/usr
- meson setup -Darchive=disabled -Dcms=disabled -Ddevel=disabled -Ddoxygen=disabled -Ddjvu=disabled -Devince=disabled -Dexecinfo=disabled -Dexiv2=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dpdf=disabled -Dspell=disabled -Dsubprojects=false -Dtiff=disabled -Dvideothumbnailer=disabled -Dwebp-pixbuf-loader=disabled -Dprefix=$GITHUB_WORKSPACE/AppDir/usr build
+ meson setup -Darchive=disabled -Dcms=disabled -Ddevel=disabled -Ddoxygen=disabled -Ddjvu=disabled -Devince=disabled -Dexecinfo=disabled -Dexiv2=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dpdf=disabled -Dspell=disabled -Dtiff=disabled -Dvideothumbnailer=disabled -Dwebp=disabled -Dprefix=$GITHUB_WORKSPACE/AppDir/usr build
ninja -C build install
tar -czvf geeqie.gz $GITHUB_WORKSPACE/
with:
action: build
directory: build
- setup-options: -Darchive=disabled -Dcms=disabled -Ddevel=disabled -Ddoxygen=disabled -Ddjvu=disabled -Devince=disabled -Dexecinfo=disabled -Dexiv2=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dpdf=disabled -Dspell=disabled -Dsubprojects=false -Dtiff=disabled -Dvideothumbnailer=disabled -Dwebp-pixbuf-loader=disabled
+ setup-options: -Darchive=disabled -Dcms=disabled -Ddevel=disabled -Ddoxygen=disabled -Ddjvu=disabled -Devince=disabled -Dexecinfo=disabled -Dexiv2=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dpdf=disabled -Dspell=disabled -Dtiff=disabled -Dvideothumbnailer=disabled -Dwebp=disabled
options: --verbose
meson-version: 1.0.1
- run: sudo apt-get install libunwind-dev
- run: sudo apt-get install libwebp7
- run: sudo apt-get install libwebp-dev
- - run: sudo apt-get install webp-pixbuf-loader
- run: sudo apt-get install pandoc
- run: sudo apt-get install gettext
- run: sudo apt-get install yelp-tools
- which mksquashfs || apt install squashfs-tools
AppDir:
- after_runtime: |
- ./scripts/patch-loaders-cache.sh
path: ./AppDir
app_info:
id: geeqie
- libtiff5
- libunwind8
- libwebp7
- - webp-pixbuf-loader
files:
include: []
- which mksquashfs || apt install squashfs-tools
AppDir:
- after_runtime: |
- ./scripts/patch-loaders-cache.sh
path: /home/runner/work/geeqie/geeqie/AppDir/
app_info:
id: geeqie
- libtiff5
- libunwind8
- libwebp7
- - webp-pixbuf-loader
files:
include: []
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = build \
- subprojects
+EXCLUDE = build
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
## Dialogs allow the user to install additional features.
##
-version="2023-12-29"
+version="2024-01-22"
description='
Geeqie is an image viewer.
This script will download, compile, and install Geeqie on Debian-based systems.
libimage-exiftool-perl
libheif (for HEIF support)
libheif-dev
-webp-pixbuf-loader (for WebP images)
-webp-pixbuf-loader
+libwebp (for WebP images)
+libwebp-dev
libdjvulibre (for DjVu images)
libdjvulibre-dev
libopenjp2 (for JP2 images)
summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
endif
-# Check for subproject handling
-option = get_option('subprojects')
-if option
- summary({'subprojects' : ['subprojects enabled:', true]}, section : 'Configuration', bool_yn : true)
-else
- summary({'subprojects' : ['subprojects enabled:', false]}, section : 'Configuration', bool_yn : true)
-endif
-
tiff_dep = []
option = get_option('tiff')
if not option.disabled()
summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
endif
-webp_pixbuf_loader_version = '0.0'
-option = get_option('webp-pixbuf-loader')
+libwebp_dep = []
+req_version = '>=0.6.1'
+option = get_option('webp')
if not option.disabled()
- cmd = find_program('dpkg-query', required: false)
- if cmd.found()
- pkg_res = run_command(cmd, '--show', 'webp-pixbuf-loader', check: false)
- endif
-
- if not cmd.found()
- cmd = find_program('pacman', required: false)
- if cmd.found()
- pkg_res = run_command(cmd, '-Q', 'webp-pixbuf-loader', check: false)
- endif
- endif
-
- if cmd.found()
- if pkg_res.returncode() == 0
- pkg_list = pkg_res.stdout().split()
- px = pkg_list.get(1)
- pkg_list2 = px.split('-')
- webp_pixbuf_loader_version= pkg_list.get(1).split('-').get(0)
- endif
-
- # Loader version 0.2.1 is OK. Versions 0.2.2 to 0.2.4 need patching via a subproject
- # In that case if subprojects are disabled the loader is indicated as failing
- # Anything later than 0.2.4 is assumed to be OK
- if webp_pixbuf_loader_version.version_compare('==0.0')
- summary({'webp_pixbuf_loader' : ['webp-pixbuf-loader not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
- else
- message('webp-pixbuf-loader found: ' + webp_pixbuf_loader_version)
- if webp_pixbuf_loader_version.version_compare('<0.2.2')
- summary({'webp_pixbuf_loader' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
- conf_data.set('HAVE_WEBP', 1)
- elif webp_pixbuf_loader_version.version_compare('<=0.2.4')
- if get_option('subprojects')
- webp_pixbuf_loader_proj = subproject('webp-pixbuf-loader')
-
- if webp_pixbuf_loader_proj.found()
- meson.add_install_script('./scripts/update-pixbuf-loaders-cache.sh')
- summary({'webp_pixbuf_loader' : ['webp files supported as subproject:', true]}, section : 'Configuration', bool_yn : true)
- conf_data.set('HAVE_WEBP', 1)
- else
- summary({'webp_pixbuf_loader' : ['webp subproject failed - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
- endif
- else
- summary({'webp_pixbuf_loader' : ['webp files supported:', false]}, section : 'Configuration', bool_yn : true)
- endif
- else
- summary({'webp_pixbuf_loader' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
- conf_data.set('HAVE_WEBP', 1)
- endif
- endif
+ libwebp_dep = dependency('libwebp', version : req_version, required : get_option('webp'))
+ if libwebp_dep.found()
+ conf_data.set('HAVE_WEBP', 1)
+ summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
else
- summary({'webp_pixbuf_loader' : ['dpkg or pacman not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
+ summary({'webp' : ['libwebp ' + req_version + ' not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
- summary({'webp_pixbuf_loader' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
+ summary({'webp' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
# Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
option('pandoc', type : 'feature', value : 'auto', description : 'README.html')
option('pdf', type : 'feature', value : 'auto', description : 'pdf')
option('spell', type : 'feature', value : 'auto', description : 'spelling checks')
-option('subprojects', type : 'boolean', value : 'true', description : 'subprojects')
option('tiff', type : 'feature', value : 'auto', description : 'tiff')
option('videothumbnailer', type : 'feature', value : 'auto', description : 'video thumbnailer')
-option('webp-pixbuf-loader', type : 'feature', value : 'auto', description : 'webp pixbuf loader')
+option('webp', type : 'feature', value : 'auto', description : 'webp')
option('yelp-build', type : 'feature', value : 'auto', description : 'help files')
'lua-test.sh',
'modify-downloaded-icons.sh',
'new-release.sh',
-'patch-loaders-cache.sh',
'template-desktop.sh',
'translators.sh',
'untranslated-text.sh',
-'update-pixbuf-loaders-cache.sh',
'web-help.sh')
+++ /dev/null
-#!/bin/sh
-#**********************************************************************
-# Copyright (C) 2023 - 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.
-#**********************************************************************
-
-## @file
-## @brief Update pixbuf loaders.cache file
-##
-## Required only for webp-pixbuf-loader subproject, and
-## is run only when an AppImage is being created
-##
-
-loader=$(find ./AppDir/usr/local -name libpixbufloader-webp.so)
-
-if [ -f "$loader" ]
-then
- loaders_cache=$(find ./AppDir/usr/local/lib -name loaders.cache)
- loaders_src=$(dirname "$loader" | sed s/local//)
- loaders_dest=$(dirname "$loader")
-
- cat << EOF >> "$loaders_cache"
-"libpixbufloader-webp.so"
-"webp" 5 "gdk-pixbuf" "The WebP image format" "LGPL"
-"image/webp" "audio/x-riff" ""
-"webp" ""
-"RIFFsizeWEBP" " xxxx " 100
-
-EOF
-
- cp -r "$loaders_src/." "$loaders_dest"
-fi
+++ /dev/null
-#!/bin/sh
-#**********************************************************************
-# Copyright (C) 2023 - 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.
-#**********************************************************************
-
-## @file
-## @brief Update pixbuf loaders.cache file
-##
-## Required only for webp-pixbuf-loader subproject, and
-## only when Geeqie is being installed
-##
-
-loader=$(find /usr/local -name libpixbufloader-webp.so)
-dest=$(pkg-config gdk-pixbuf-2.0 --variable=gdk_pixbuf_moduledir)
-
-sudo cp "$loader" "$dest"
-
-sudo "$(pkg-config gdk-pixbuf-2.0 --variable=gdk_pixbuf_query_loaders)" --update-cache
--- /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-webp.h"
+
+#ifdef HAVE_WEBP
+#include <webp/decode.h>
+
+typedef struct _ImageLoaderWEBP ImageLoaderWEBP;
+struct _ImageLoaderWEBP {
+ 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)
+{
+ g_free(pixels);
+}
+
+static gboolean image_loader_webp_load(gpointer loader, const guchar *buf, gsize count, GError **)
+{
+ ImageLoaderWEBP *ld = (ImageLoaderWEBP *) loader;
+ guint8* data;
+ gint width, height;
+ gboolean res_info;
+ WebPBitstreamFeatures features;
+ VP8StatusCode status_code;
+
+ res_info = WebPGetInfo(buf, count, &width, &height);
+ if (!res_info)
+ {
+ log_printf("warning: webp reader error\n");
+ return FALSE;
+ }
+
+ status_code = WebPGetFeatures(buf, count, &features);
+ if (status_code != VP8_STATUS_OK)
+ {
+ log_printf("warning: webp reader error\n");
+ return FALSE;
+ }
+
+ if (features.has_alpha)
+ {
+ data = WebPDecodeRGBA(buf, count, &width, &height);
+ }
+ else
+ {
+ data = WebPDecodeRGB(buf, count, &width, &height);
+ }
+
+ ld->pixbuf = gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, features.has_alpha, 8, width, height, width * (features.has_alpha ? 4 : 3), free_buffer, NULL);
+
+ ld->area_updated_cb(loader, 0, 0, width, height, ld->data);
+
+ return TRUE;
+}
+
+static gpointer image_loader_webp_new(ImageLoaderBackendCbAreaUpdated area_updated_cb, ImageLoaderBackendCbSize size_cb, ImageLoaderBackendCbAreaPrepared area_prepared_cb, gpointer data)
+{
+ ImageLoaderWEBP *loader = g_new0(ImageLoaderWEBP, 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_webp_set_size(gpointer loader, int width, int height)
+{
+ ImageLoaderWEBP *ld = (ImageLoaderWEBP *) loader;
+ ld->requested_width = width;
+ ld->requested_height = height;
+}
+
+static GdkPixbuf* image_loader_webp_get_pixbuf(gpointer loader)
+{
+ ImageLoaderWEBP *ld = (ImageLoaderWEBP *) loader;
+ return ld->pixbuf;
+}
+
+static gchar* image_loader_webp_get_format_name(gpointer)
+{
+ return g_strdup("webp");
+}
+
+static gchar** image_loader_webp_get_format_mime_types(gpointer)
+{
+ static const gchar *mime[] = {"image/webp", nullptr};
+ return g_strdupv(const_cast<gchar **>(mime));
+}
+
+static gboolean image_loader_webp_close(gpointer, GError **)
+{
+ return TRUE;
+}
+
+static void image_loader_webp_abort(gpointer loader)
+{
+ ImageLoaderWEBP *ld = (ImageLoaderWEBP *) loader;
+ ld->abort = TRUE;
+}
+
+static void image_loader_webp_free(gpointer loader)
+{
+ ImageLoaderWEBP *ld = (ImageLoaderWEBP *) loader;
+ if (ld->pixbuf) g_object_unref(ld->pixbuf);
+ g_free(ld);
+}
+
+void image_loader_backend_set_webp(ImageLoaderBackend *funcs)
+{
+DEBUG_0(" " );
+ funcs->loader_new = image_loader_webp_new;
+ funcs->set_size = image_loader_webp_set_size;
+ funcs->load = image_loader_webp_load;
+ funcs->write = NULL;
+ funcs->get_pixbuf = image_loader_webp_get_pixbuf;
+ funcs->close = image_loader_webp_close;
+ funcs->abort = image_loader_webp_abort;
+ funcs->free = image_loader_webp_free;
+ funcs->get_format_name = image_loader_webp_get_format_name;
+ funcs->get_format_mime_types = image_loader_webp_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_WEBP_H
+#define IMAGE_LOAD_WEBP_H
+
+#ifdef HAVE_WEBP
+void image_loader_backend_set_webp(ImageLoaderBackend *funcs);
+#endif
+
+#endif
+/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
#include "image-load-libraw.h"
#include "image-load-psd.h"
#include "image-load-svgz.h"
+#include "image-load-webp.h"
#include "image-load-zxscr.h"
#include "misc.h"
#include "ui-fileops.h"
}
else
#endif
+#ifdef HAVE_WEBP
+ if (il->bytes_total >= 12 &&
+ (memcmp(il->mapped_file, "RIFF", 4) == 0) &&
+ (memcmp(il->mapped_file + 8, "WEBP", 4) == 0))
+ {
+ DEBUG_1("Using custom webp loader");
+ image_loader_backend_set_webp(&il->backend);
+ }
+ else
+#endif
#ifdef HAVE_DJVU
if (il->bytes_total >= 16 &&
(memcmp(il->mapped_file, "AT&TFORM", 8) == 0) &&
'image-load-svgz.h',
'image-load-tiff.cc',
'image-load-tiff.h',
+'image-load-webp.cc',
+'image-load-webp.h',
'image-load-zxscr.cc',
'image-load-zxscr.h',
'image-overlay.cc',
libopenjp2_dep,
libraw_dep,
libunwind_dep,
+libwebp_dep,
lua_dep,
poppler_glib_dep,
thread_dep,
+++ /dev/null
-diff --git a/meson.build b/meson.build
-index c46f11b..3b7d93a 100644
---- a/meson.build
-+++ b/meson.build
-@@ -7,9 +7,9 @@ if gdk_pb_moddir == ''
- gdk_pb_moddir = gdkpb.get_variable(pkgconfig: 'gdk_pixbuf_moduledir', pkgconfig_define: ['prefix', get_option('prefix')])
- endif
-
--webp = dependency('libwebp', version: '>=1.3.2')
--webpdemux = dependency('libwebpdemux', version: '>=1.3.2')
--webpmux = dependency('libwebpmux', version: '>=1.3.2')
-+webp = dependency('libwebp', version: '>=1.2.2')
-+webpdemux = dependency('libwebpdemux', version: '>=1.2.2')
-+webpmux = dependency('libwebpmux', version: '>=1.2.2')
-
- pbl_webp = shared_module('pixbufloader-webp',
- sources: ['io-webp.c', 'io-webp-anim.c', 'io-webp-anim-iter.c'],
+++ /dev/null
-diff --git a/io-webp.c b/io-webp.c
-index c67e0a9..de2f83a 100644
---- a/io-webp.c
-+++ b/io-webp.c
-@@ -143,6 +143,8 @@ stop_load (gpointer data, GError **error)
- {
- if (context->prepare_func)
- context->prepare_func (pb, GDK_PIXBUF_ANIMATION (anim), context->user_data);
-+ if (context->update_func)
-+ context->update_func (pb, 0, 0, context->width, context->height, context->user_data);
- ret = TRUE;
- }
-
-@@ -174,6 +176,9 @@ stop_load (gpointer data, GError **error)
- return FALSE;
- }
-
-+ if (context->prepare_func)
-+ context->prepare_func (pb, NULL, context->user_data);
-+
- if (icc_data)
- {
- gdk_pixbuf_set_option (pb, "icc-profile", icc_data);
-@@ -187,10 +192,8 @@ stop_load (gpointer data, GError **error)
- context->buffer->len, &config);
- if (status == VP8_STATUS_OK)
- {
-- if (context->prepare_func)
-- context->prepare_func (pb, NULL, context->user_data);
--
-- g_clear_object (&pb);
-+ if (context->update_func)
-+ context->update_func (pb, 0, 0, context->width, context->height, context->user_data);
-
- ret = TRUE;
- }
-@@ -198,6 +201,8 @@ stop_load (gpointer data, GError **error)
- g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED,
- "WebP decoder failed with VP8 status code: %d", status);
- }
-+
-+ g_clear_object (&pb);
- }
-
- if (context->buffer)
+++ /dev/null
-[wrap-git]
-url = https://github.com/aruiz/webp-pixbuf-loader.git
-revision = head
-depth = 1
-directory = webp-pixbuf-loader
-diff_files = webp-pixbuf-loader/pull-73.diff, webp-pixbuf-loader/meson-build.diff