Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package zathura-plugin-cb for
openSUSE:Factory checked in at 2026-05-29 18:10:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/zathura-plugin-cb (Old)
and /work/SRC/openSUSE:Factory/.zathura-plugin-cb.new.1937 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zathura-plugin-cb"
Fri May 29 18:10:59 2026 rev:8 rq:1355835 version:2026.05.10
Changes:
--------
--- /work/SRC/openSUSE:Factory/zathura-plugin-cb/zathura-plugin-cb.changes
2024-08-13 13:24:04.952342617 +0200
+++
/work/SRC/openSUSE:Factory/.zathura-plugin-cb.new.1937/zathura-plugin-cb.changes
2026-05-29 18:12:31.943949818 +0200
@@ -1,0 +2,18 @@
+Fri May 29 09:02:49 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Cleanup spec file with spec-cleaner
+
+-------------------------------------------------------------------
+Wed May 27 08:02:59 UTC 2026 - Андрей Алыпов <[email protected]>
+
+- Update to version 2026.05.10:
+ * Various bug fixes and improvements
+- Added zathura-cb.keyring
+- Updates from version 2026.02.03:
+ * Update for changes in girara
+- Updates from version 2026.01.30:
+ * Various bug fixes and improvements
+- Updates from version 0.1.12:
+ * Various bug fixes and improvements
+
+-------------------------------------------------------------------
Old:
----
zathura-cb-0.1.11.tar.xz
New:
----
zathura-cb-2026.05.10.tar.xz
zathura-cb-2026.05.10.tar.xz.asc
zathura-cb.keyring
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ zathura-plugin-cb.spec ++++++
--- /var/tmp/diff_new_pack.3E9ujy/_old 2026-05-29 18:12:34.012035866 +0200
+++ /var/tmp/diff_new_pack.3E9ujy/_new 2026-05-29 18:12:34.044037197 +0200
@@ -1,7 +1,7 @@
#
# spec file for package zathura-plugin-cb
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,35 +17,50 @@
%define realname zathura-cb
+%if 0%{?suse_version} == 1600
+%bcond_without gcc15
+%endif
Name: zathura-plugin-cb
-Version: 0.1.11
+Version: 2026.05.10
Release: 0
Summary: Comic book support for zathura
License: Zlib
-Group: Productivity/Office/Other
-URL: http://pwmt.org/projects/zathura/plugins/zathura-cb/
-Source:
https://pwmt.org/projects/zathura-cb/download/%{realname}-%{version}.tar.xz
-BuildRequires: meson >= 0.61
+URL: https://pwmt.org/projects/zathura-cb
+Source0: %{url}/download/%{realname}-%{version}.tar.xz
+Source1: %{url}/download/%{realname}-%{version}.tar.xz.asc
+Source2: %{realname}.keyring
+BuildRequires: AppStream
+BuildRequires: c_compiler
+BuildRequires: desktop-file-utils
+BuildRequires: meson >= 1.5
BuildRequires: pkgconfig
-BuildRequires: pkgconfig(girara-gtk3)
-BuildRequires: pkgconfig(libarchive)
-BuildRequires: pkgconfig(zathura) >= 0.3.8
-Requires: zathura
-Provides: zathura-cb-plugin
+BuildRequires: pkgconfig(cairo)
+BuildRequires: pkgconfig(girara)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(libarchive) >= 3
+BuildRequires: pkgconfig(zathura) >= 2026.01.30
+Requires: zathura >= 2026.01.30
+Provides: %{realname}-plugin
+%if %{with gcc15}
+BuildRequires: gcc15
+%endif
%description
The zathura-cb plugin adds comic book support to zathura.
%prep
-%setup -q -n %{realname}-%{version}
+%autosetup -p1 -n %{realname}-%{version}
%build
-export CFLAGS="%{optflags}"
-%meson -Dtests=disabled
+%{?with_gcc15:export CC=gcc-15}
+%meson
%meson_build
%install
%meson_install
+
+%check
+%meson_test
find %{buildroot} -name '*.desktop' -delete -print
%files -n %{name}
@@ -53,5 +68,5 @@
%doc AUTHORS
%dir %{_libdir}/zathura
%{_libdir}/zathura/libcb.so
-%{_datadir}/metainfo/org.pwmt.zathura-cb.metainfo.xml
+%{_datadir}/metainfo/org.pwmt.%{realname}.metainfo.xml
++++++ zathura-cb-0.1.11.tar.xz -> zathura-cb-2026.05.10.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/.github/dependabot.yml
new/zathura-cb-2026.05.10/.github/dependabot.yml
--- old/zathura-cb-0.1.11/.github/dependabot.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/zathura-cb-2026.05.10/.github/dependabot.yml 2026-05-10
13:45:45.000000000 +0200
@@ -0,0 +1,6 @@
+version: 2
+updates:
+- package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/.github/workflows/build.yaml
new/zathura-cb-2026.05.10/.github/workflows/build.yaml
--- old/zathura-cb-0.1.11/.github/workflows/build.yaml 1970-01-01
01:00:00.000000000 +0100
+++ new/zathura-cb-2026.05.10/.github/workflows/build.yaml 2026-05-10
13:45:45.000000000 +0200
@@ -0,0 +1,193 @@
+name: CI
+
+on:
+ push:
+ pull_request:
+
+env:
+ VERBOSE: 1
+
+jobs:
+ clang-format:
+ name: Check clang-format output
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-debian:forky
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu girara/build
girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu
zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu build .
+ ninja -C build clang-format-check
+
+ build-test-debian-trixie:
+ name: Test on Debian trixie
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-debian:trixie
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu girara/build
girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu
zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu build .
+ ninja -C build --verbose
+ ninja -C build test --verbose
+
+ build-test-debian-forky:
+ name: Test on Debian forky
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-debian:forky
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu girara/build
girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu
zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu build .
+ ninja -C build --verbose
+ ninja -C build test --verbose
+
+ build-test-ubuntu-resolute:
+ name: Test on Ubuntu resolute
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-ubuntu:resolute
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu girara/build
girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu
zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu build .
+ ninja -C build --verbose
+ ninja -C build test --verbose
+
+ build-test-archlinux:
+ name: Test on Archlinux
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-archlinux:latest
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr girara/build girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr build .
+ ninja -C build --verbose
+ ninja -C build test --verbose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/README.md
new/zathura-cb-2026.05.10/README.md
--- old/zathura-cb-0.1.11/README.md 2024-08-04 10:28:38.000000000 +0200
+++ new/zathura-cb-2026.05.10/README.md 2026-05-10 13:45:45.000000000 +0200
@@ -6,8 +6,8 @@
Requirements
------------
-* `zathura` (>= 0.2.0)
-* `libarchive`
+* `zathura` (>= 2026.01.30)
+* `libarchive` (>= 3)
* `girara`
* `cairo`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/data/meson.build
new/zathura-cb-2026.05.10/data/meson.build
--- old/zathura-cb-0.1.11/data/meson.build 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/data/meson.build 2026-05-10 13:45:45.000000000
+0200
@@ -9,10 +9,10 @@
)
endif
-appstream_util = find_program('appstream-util', required: get_option('tests'),
native: true)
+appstream_util = find_program('appstreamcli', required: get_option('tests'),
native: true)
if appstream_util.found()
test('validate-appdata',
appstream_util,
- args: ['validate-relax', '--nonet', join_paths(meson.current_source_dir(),
'org.pwmt.zathura-cb.metainfo.xml')]
+ args: ['validate', '--no-net', join_paths(meson.current_source_dir(),
'org.pwmt.zathura-cb.metainfo.xml')]
)
endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zathura-cb-0.1.11/data/org.pwmt.zathura-cb.metainfo.xml
new/zathura-cb-2026.05.10/data/org.pwmt.zathura-cb.metainfo.xml
--- old/zathura-cb-0.1.11/data/org.pwmt.zathura-cb.metainfo.xml 2024-08-04
10:28:38.000000000 +0200
+++ new/zathura-cb-2026.05.10/data/org.pwmt.zathura-cb.metainfo.xml
2026-05-10 13:45:45.000000000 +0200
@@ -4,9 +4,22 @@
<id>org.pwmt.zathura-cb</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>Zlib</project_license>
+ <developer id="org.pwmt">
+ <name>pwmt</name>
+ </developer>
<extends>org.pwmt.zathura</extends>
<name>Zathura-CB</name>
<summary>Comic book plugin for zathura</summary>
- <url type="homepage">https://pwmt.org/projects/zathur-cb/</url>
- <update_contact>[email protected]</update_contact>
+ <url type="homepage">https://pwmt.org/projects/zathura-cb/</url>
+ <url type="bugtracker">https://github.com/pwmt/zathura-cb/issues</url>
+ <url type="donation">https://pwmt.org/help/donate</url>
+ <url type="contact">https://pwmt.org/contact</url>
+ <url type="vcs-browser">https://github.com/pwmt/zathura-cb</url>
+ <releases>
+ <release version="2026.05.10" date="2026-05-10" />
+ <release version="2026.02.03" date="2026-02-03" />
+ <release version="2026.01.30" date="2026-01-30" />
+ <release version="0.1.12" date="2025-10-28" />
+ <release version="0.1.11" date="2024-08-04" />
+ </releases>
</component>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/meson.build
new/zathura-cb-2026.05.10/meson.build
--- old/zathura-cb-0.1.11/meson.build 2024-08-04 10:28:38.000000000 +0200
+++ new/zathura-cb-2026.05.10/meson.build 2026-05-10 13:45:45.000000000
+0200
@@ -1,7 +1,7 @@
project('zathura-cb', 'c',
- version: '0.1.11',
+ version: '2026.05.10',
meson_version: '>=0.61',
- default_options: ['c_std=c17', 'warning_level=3']
+ default_options: ['c_std=c23', 'warning_level=3']
)
version = meson.project_version()
@@ -14,11 +14,11 @@
metainfodir = join_paths(datadir, 'metainfo')
# required dependencies
-zathura = dependency('zathura', version: '>=0.3.8')
-girara = dependency('girara-gtk3')
+zathura = dependency('zathura', version: '>=2026.01.30')
+girara = dependency('girara')
glib = dependency('glib-2.0')
cairo = dependency('cairo')
-libarchive = dependency('libarchive')
+libarchive = dependency('libarchive', version: '>=3')
build_dependencies = [zathura, girara, glib, cairo, libarchive]
@@ -38,12 +38,10 @@
# compile flags
flags = [
- '-Wall',
- '-Wextra',
- '-pedantic',
'-Werror=implicit-function-declaration',
'-Werror=vla',
- '-fvisibility=hidden'
+ '-Werror=int-conversion',
+ '-Werror=maybe-uninitialized'
]
flags = cc.get_supported_arguments(flags)
@@ -61,7 +59,8 @@
dependencies: build_dependencies,
c_args: defines + flags,
install: true,
- install_dir: plugindir
+ install_dir: plugindir,
+ gnu_symbol_visibility: 'hidden'
)
subdir('data')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/document.c
new/zathura-cb-2026.05.10/zathura-cb/document.c
--- old/zathura-cb-0.1.11/zathura-cb/document.c 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/document.c 2026-05-10
13:45:45.000000000 +0200
@@ -4,7 +4,6 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
-#include <gtk/gtk.h>
#include <glib/gstdio.h>
#include <girara/datastructures.h>
#include <archive.h>
@@ -14,28 +13,40 @@
#include "internal.h"
#include "utils.h"
-static int compare_pages(const cb_document_page_meta_t* page1, const
cb_document_page_meta_t* page2);
static bool read_archive(cb_document_t* cb_document, const char* archive,
girara_list_t* supported_extensions);
static char* get_extension(const char* path);
-static void cb_document_page_meta_free(cb_document_page_meta_t* meta);
static bool read_dir(cb_document_t* cb_document, const char* directory,
girara_list_t* supported_extensions);
+static void cb_document_page_meta_free(void* data) {
+ if (data != NULL) {
+ cb_document_page_meta_t* meta = data;
+ g_free(meta->file);
+ g_free(meta);
+ }
+}
+
+static int compare_pages(const void* p1, const void* p2) {
+ const cb_document_page_meta_t* page1 = p1;
+ const cb_document_page_meta_t* page2 = p2;
+
+ return compare_path(page1->file, page2->file);
+}
+
zathura_error_t cb_document_open(zathura_document_t* document) {
if (document == NULL) {
return ZATHURA_ERROR_INVALID_ARGUMENTS;
}
- cb_document_t* cb_document = g_malloc0(sizeof(cb_document_t));
/* archive path */
const char* path = zathura_document_get_path(document);
/* create list of supported formats */
- girara_list_t* supported_extensions = girara_list_new2(g_free);
+ g_autoptr(girara_list_t) supported_extensions =
girara_list_new_with_free(g_free);
if (supported_extensions == NULL) {
- goto error_free;
+ return ZATHURA_ERROR_UNKNOWN;
}
- GSList* formats = gdk_pixbuf_get_formats();
+ g_autoptr(GSList) formats = gdk_pixbuf_get_formats();
for (GSList* list = formats; list != NULL; list = list->next) {
GdkPixbufFormat* format = (GdkPixbufFormat*)list->data;
char** extensions = gdk_pixbuf_format_get_extensions(format);
@@ -46,11 +57,11 @@
g_strfreev(extensions);
}
- g_slist_free(formats);
+
+ cb_document_t* cb_document = g_malloc0(sizeof(cb_document_t));
/* create list of supported files (pages) */
- cb_document->pages =
girara_sorted_list_new2((girara_compare_function_t)compare_pages,
-
(girara_free_function_t)cb_document_page_meta_free);
+ cb_document->pages = girara_sorted_list_new_with_free(compare_pages,
cb_document_page_meta_free);
if (cb_document->pages == NULL) {
goto error_free;
}
@@ -66,8 +77,6 @@
}
}
- girara_list_free(supported_extensions);
-
/* set document information */
zathura_document_set_number_of_pages(document,
girara_list_size(cb_document->pages));
zathura_document_set_data(document, cb_document);
@@ -76,7 +85,6 @@
error_free:
- girara_list_free(supported_extensions);
cb_document_free(document, cb_document);
return ZATHURA_ERROR_UNKNOWN;
@@ -98,17 +106,6 @@
return ZATHURA_ERROR_OK;
}
-static void cb_document_page_meta_free(cb_document_page_meta_t* meta) {
- if (meta == NULL) {
- return;
- }
-
- if (meta->file != NULL) {
- g_free(meta->file);
- }
- g_free(meta);
-}
-
static void get_pixbuf_size(GdkPixbufLoader* loader, int width, int height,
gpointer data) {
cb_document_page_meta_t* meta = (cb_document_page_meta_t*)data;
@@ -119,7 +116,7 @@
}
static bool read_archive(cb_document_t* cb_document, const char* archive,
girara_list_t* supported_extensions) {
- struct archive* a = archive_read_new();
+ g_autoptr(archive_t) a = archive_read_new();
if (a == NULL) {
return false;
}
@@ -128,7 +125,6 @@
archive_read_support_format_all(a);
int r = archive_read_open_filename(a, archive,
(size_t)LIBARCHIVE_BUFFER_SIZE);
if (r != ARCHIVE_OK) {
- archive_read_free(a);
return false;
}
@@ -136,9 +132,9 @@
while ((r = archive_read_next_header(a, &entry)) != ARCHIVE_EOF) {
if (r < ARCHIVE_WARN) {
// let's ignore warnings ... they are non-fatal errors
- archive_read_close(a);
- archive_read_free(a);
return false;
+ } else if (r == ARCHIVE_RETRY) {
+ continue;
}
if (archive_entry_filetype(entry) != AE_IFREG) {
@@ -146,8 +142,8 @@
continue;
}
- const char* path = archive_entry_pathname(entry);
- char* extension = get_extension(path);
+ const char* path = archive_entry_pathname(entry);
+ g_autofree char* extension = get_extension(path);
if (extension == NULL) {
continue;
@@ -159,22 +155,19 @@
cb_document_page_meta_t* meta =
g_malloc0(sizeof(cb_document_page_meta_t));
meta->file = g_strdup(path);
- GdkPixbufLoader* loader = gdk_pixbuf_loader_new();
+ g_autoptr(GdkPixbufLoader) loader = gdk_pixbuf_loader_new();
g_signal_connect(loader, "size-prepared", G_CALLBACK(get_pixbuf_size),
meta);
- size_t size = 0;
- const void* buf = NULL;
- __LA_INT64_T offset = 0;
- while ((r = archive_read_data_block(a, &buf, &size, &offset)) !=
ARCHIVE_EOF) {
- if (r < ARCHIVE_WARN) {
- break;
- }
-
- if (buf == NULL || size <= 0) {
+ uint8_t buf[LIBARCHIVE_BUFFER_SIZE];
+ la_ssize_t bytes_read;
+ while ((bytes_read = archive_read_data(a, buf, sizeof(buf))) != 0) {
+ if (bytes_read == ARCHIVE_RETRY) {
continue;
+ } else if (bytes_read < 0) {
+ break;
}
- if (gdk_pixbuf_loader_write(loader, buf, size, NULL) == false) {
+ if (gdk_pixbuf_loader_write(loader, buf, bytes_read, NULL) == false)
{
break;
}
@@ -184,7 +177,6 @@
}
gdk_pixbuf_loader_close(loader, NULL);
- g_object_unref(loader);
if (meta->width > 0 && meta->height > 0) {
girara_list_append(cb_document->pages, meta);
@@ -195,21 +187,20 @@
break;
}
}
-
- g_free(extension);
}
- archive_read_close(a);
- archive_read_free(a);
return true;
}
static bool read_dir(cb_document_t* cb_document, const char* directory,
girara_list_t* supported_extensions) {
- GDir* dir = g_dir_open(directory, 0, NULL);
+ g_autoptr(GDir) dir = g_dir_open(directory, 0, NULL);
+ if (dir == NULL) {
+ return false;
+ }
const char* entrypath = NULL;
while ((entrypath = g_dir_read_name(dir))) {
- char* fullpath = g_strdup_printf("%s/%s", directory, entrypath);
- char* extension = get_extension(fullpath);
+ g_autofree char* fullpath = g_strdup_printf("%s/%s", directory,
entrypath);
+ g_autofree char* extension = get_extension(fullpath);
if (extension == NULL) {
continue;
}
@@ -219,10 +210,10 @@
if (g_strcmp0(ext, extension) == 0) {
cb_document_page_meta_t* meta =
g_malloc(sizeof(cb_document_page_meta_t));
meta->file = g_strdup(fullpath);
- g_free(fullpath);
- GdkPixbuf* data = gdk_pixbuf_new_from_file(meta->file, NULL);
- meta->width = gdk_pixbuf_get_width(data);
- meta->height = gdk_pixbuf_get_height(data);
+
+ g_autoptr(GdkPixbuf) data = gdk_pixbuf_new_from_file(meta->file, NULL);
+ meta->width = gdk_pixbuf_get_width(data);
+ meta->height = gdk_pixbuf_get_height(data);
if (meta->width > 0 && meta->height > 0) {
girara_list_append(cb_document->pages, meta);
@@ -233,17 +224,10 @@
break;
}
}
-
- g_free(extension);
}
- g_dir_close(dir);
return true;
}
-static int compare_pages(const cb_document_page_meta_t* page1, const
cb_document_page_meta_t* page2) {
- return compare_path(page1->file, page2->file);
-}
-
static char* get_extension(const char* path) {
if (path == NULL) {
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/internal.h
new/zathura-cb-2026.05.10/zathura-cb/internal.h
--- old/zathura-cb-0.1.11/zathura-cb/internal.h 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/internal.h 2026-05-10
13:45:45.000000000 +0200
@@ -11,6 +11,7 @@
struct cb_page_s {
char* file; /**< Image associated to the page */
+ GdkPixbuf* pixbuf;
};
/** Image meta-data read during the document initialization
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/page.c
new/zathura-cb-2026.05.10/zathura-cb/page.c
--- old/zathura-cb-0.1.11/zathura-cb/page.c 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/page.c 2026-05-10 13:45:45.000000000
+0200
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: Zlib */
#include <glib.h>
-#include <gtk/gtk.h>
#include "plugin.h"
#include "internal.h"
@@ -23,7 +22,7 @@
return ZATHURA_ERROR_UNKNOWN;
}
- cb_page_t* cb_page = g_malloc0(sizeof(cb_page_t));
+ cb_page_t* cb_page = g_try_malloc0(sizeof(cb_page_t));
if (cb_page == NULL) {
return ZATHURA_ERROR_OUT_OF_MEMORY;
}
@@ -42,6 +41,9 @@
return ZATHURA_ERROR_OK;
}
+ if (cb_page->pixbuf) {
+ g_object_unref(cb_page->pixbuf);
+ }
g_free(cb_page->file);
g_free(cb_page);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/plugin.h
new/zathura-cb-2026.05.10/zathura-cb/plugin.h
--- old/zathura-cb-0.1.11/zathura-cb/plugin.h 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/plugin.h 2026-05-10
13:45:45.000000000 +0200
@@ -19,7 +19,7 @@
* @param document The document
* @return ZATHURA_ERROR_OK if no error occurred
*/
-GIRARA_HIDDEN zathura_error_t cb_document_open(zathura_document_t* document);
+zathura_error_t cb_document_open(zathura_document_t* document);
/**
* Frees the document
@@ -28,7 +28,7 @@
* @param data Custom data
* @return ZATHURA_ERROR_OK if no error occurred
*/
-GIRARA_HIDDEN zathura_error_t cb_document_free(zathura_document_t* document,
void* cb_document);
+zathura_error_t cb_document_free(zathura_document_t* document, void*
cb_document);
/**
* Generates the index of the document
@@ -39,8 +39,7 @@
* @return Tree node object or NULL if an error occurred (e.g.: the document
has
* no index)
*/
-GIRARA_HIDDEN girara_tree_node_t*
cb_document_index_generate(zathura_document_t* document, void* cb_document,
- zathura_error_t*
error);
+girara_tree_node_t* cb_document_index_generate(zathura_document_t* document,
void* cb_document, zathura_error_t* error);
/**
* Initializes a page
@@ -57,7 +56,7 @@
* @param cb_page cb Page
* @return ZATHURA_ERROR_OK if no error occurred
*/
-GIRARA_HIDDEN zathura_error_t cb_page_clear(zathura_page_t* page, void*
cb_page);
+zathura_error_t cb_page_clear(zathura_page_t* page, void* cb_page);
/**
* Renders the page to a cairo object
@@ -68,6 +67,6 @@
* @param printing Render for printing
* @return ZATHURA_ERROR_OK if no error occurred
*/
-GIRARA_HIDDEN zathura_error_t cb_page_render_cairo(zathura_page_t* page, void*
cb_page, cairo_t* cairo, bool printing);
+zathura_error_t cb_page_render_cairo(zathura_page_t* page, void* cb_page,
cairo_t* cairo, bool printing);
#endif // CB_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/render.c
new/zathura-cb-2026.05.10/zathura-cb/render.c
--- old/zathura-cb-0.1.11/zathura-cb/render.c 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/render.c 2026-05-10
13:45:45.000000000 +0200
@@ -3,122 +3,104 @@
#include <gio/gio.h>
#include <archive.h>
#include <archive_entry.h>
-#include <gtk/gtk.h>
#include <string.h>
#include "plugin.h"
#include "internal.h"
#include "utils.h"
-static GdkPixbuf* load_pixbuf_from_archive(const char* archive, const char*
file);
-
-zathura_error_t cb_page_render_cairo(zathura_page_t* page, void* data,
cairo_t* cairo, bool UNUSED(printing)) {
- cb_page_t* cb_page = data;
- if (page == NULL || cb_page == NULL || cairo == NULL) {
- return ZATHURA_ERROR_INVALID_ARGUMENTS;
+static GdkPixbuf* load_pixbuf_from_archive(zathura_page_t* page, const char*
archive, const char* file) {
+ if (archive == NULL || file == NULL) {
+ return NULL;
}
- zathura_document_t* document = zathura_page_get_document(page);
- if (document == NULL) {
- return ZATHURA_ERROR_UNKNOWN;
+ if (g_file_test(archive, G_FILE_TEST_IS_DIR)) {
+ return gdk_pixbuf_new_from_file(file, NULL);
}
- GdkPixbuf* pixbuf =
load_pixbuf_from_archive(zathura_document_get_path(document), cb_page->file);
- if (pixbuf == NULL) {
- return ZATHURA_ERROR_UNKNOWN;
+ cb_page_t* internal_page = zathura_page_get_data(page);
+ if (internal_page->pixbuf) {
+ return g_object_ref(internal_page->pixbuf);
}
- gdk_cairo_set_source_pixbuf(cairo, pixbuf, 0, 0);
- cairo_paint(cairo);
- g_object_unref(pixbuf);
-
- return ZATHURA_ERROR_OK;
-}
+ g_autoptr(archive_t) a = archive_read_new();
+ if (a == NULL) {
+ return NULL;
+ }
-static GdkPixbuf* load_pixbuf_from_archive(const char* archive, const char*
file) {
- if (archive == NULL || file == NULL) {
+ archive_read_support_filter_all(a);
+ archive_read_support_format_all(a);
+ int r = archive_read_open_filename(a, archive, LIBARCHIVE_BUFFER_SIZE);
+ if (r != ARCHIVE_OK) {
return NULL;
}
- if (g_file_test(archive, G_FILE_TEST_IS_DIR)) {
- return gdk_pixbuf_new_from_file(file, NULL);
- } else {
- struct archive* a = archive_read_new();
- if (a == NULL) {
+ struct archive_entry* entry = NULL;
+ while ((r = archive_read_next_header(a, &entry)) != ARCHIVE_EOF) {
+ if (r < ARCHIVE_WARN) {
return NULL;
+ } else if (r == ARCHIVE_RETRY) {
+ continue;
}
- archive_read_support_filter_all(a);
- archive_read_support_format_all(a);
- int r = archive_read_open_filename(a, archive, LIBARCHIVE_BUFFER_SIZE);
- if (r != ARCHIVE_OK) {
- return NULL;
+ const char* path = archive_entry_pathname(entry);
+ if (compare_path(path, file) != 0) {
+ continue;
}
- struct archive_entry* entry = NULL;
- while ((r = archive_read_next_header(a, &entry)) != ARCHIVE_EOF) {
- if (r < ARCHIVE_WARN) {
- archive_read_close(a);
- archive_read_free(a);
- return NULL;
- }
+ g_autoptr(GInputStream) is = g_memory_input_stream_new();
+ if (is == NULL) {
+ return NULL;
+ }
+ GMemoryInputStream* mis = G_MEMORY_INPUT_STREAM(is);
- const char* path = archive_entry_pathname(entry);
- if (compare_path(path, file) != 0) {
+ uint8_t buf[LIBARCHIVE_BUFFER_SIZE];
+ la_ssize_t bytes_read;
+ while ((bytes_read = archive_read_data(a, buf, sizeof(buf))) != 0) {
+ if (bytes_read == ARCHIVE_RETRY) {
continue;
}
-
- GInputStream* is = g_memory_input_stream_new();
- if (is == NULL) {
- archive_read_close(a);
- archive_read_free(a);
+ if (bytes_read < 0) {
return NULL;
}
- GMemoryInputStream* mis = G_MEMORY_INPUT_STREAM(is);
-
- size_t size = 0;
- const void* buf = NULL;
- __LA_INT64_T offset = 0;
- while ((r = archive_read_data_block(a, &buf, &size, &offset)) !=
ARCHIVE_EOF) {
- if (r < ARCHIVE_WARN) {
- archive_read_close(a);
- archive_read_free(a);
- g_object_unref(mis);
- return NULL;
- }
-
- if (size == 0 || buf == NULL) {
- continue;
- }
-
- void* tmp = g_malloc0(size);
- if (tmp == NULL) {
- archive_read_close(a);
- archive_read_free(a);
- g_object_unref(mis);
- return NULL;
- }
-
- memcpy(tmp, buf, size);
- g_memory_input_stream_add_data(mis, tmp, size, g_free);
- }
- GdkPixbuf* pixbuf = gdk_pixbuf_new_from_stream(is, NULL, NULL);
- if (pixbuf == NULL) {
- archive_read_close(a);
- archive_read_free(a);
- g_object_unref(mis);
+ void* tmp = g_memdup2(buf, bytes_read);
+ if (tmp == NULL) {
return NULL;
}
- archive_read_close(a);
- archive_read_free(a);
- g_object_unref(mis);
- return pixbuf;
+ g_memory_input_stream_add_data(mis, tmp, bytes_read, g_free);
}
- archive_read_close(a);
- archive_read_free(a);
+ GdkPixbuf* pixbuf = gdk_pixbuf_new_from_stream(is, NULL, NULL);
+ if (pixbuf == NULL) {
+ return NULL;
+ }
+ internal_page->pixbuf = g_object_ref(pixbuf);
+ return pixbuf;
}
+
return NULL;
}
+
+zathura_error_t cb_page_render_cairo(zathura_page_t* page, void* data,
cairo_t* cairo, bool UNUSED(printing)) {
+ cb_page_t* cb_page = data;
+ if (page == NULL || cb_page == NULL || cairo == NULL) {
+ return ZATHURA_ERROR_INVALID_ARGUMENTS;
+ }
+
+ zathura_document_t* document = zathura_page_get_document(page);
+ if (document == NULL) {
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+
+ g_autoptr(GdkPixbuf) pixbuf = load_pixbuf_from_archive(page,
zathura_document_get_path(document), cb_page->file);
+ if (pixbuf == NULL) {
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+
+ gdk_cairo_set_source_pixbuf(cairo, pixbuf, 0, 0);
+ cairo_paint(cairo);
+
+ return ZATHURA_ERROR_OK;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/utils.c
new/zathura-cb-2026.05.10/zathura-cb/utils.c
--- old/zathura-cb-0.1.11/zathura-cb/utils.c 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/utils.c 2026-05-10
13:45:45.000000000 +0200
@@ -1,21 +1,23 @@
/* SPDX-License-Identifier: Zlib */
-#include <glib.h>
-
#include "utils.h"
+#include <archive.h>
+#include <glib.h>
+
int compare_path(const char* str1, const char* str2) {
- char* ustr1 = g_utf8_casefold(str1, -1);
- char* ustr2 = g_utf8_casefold(str2, -1);
+ g_autofree char* ustr1 = g_utf8_casefold(str1, -1);
+ g_autofree char* ustr2 = g_utf8_casefold(str2, -1);
+
+ g_autofree char* ustr3 = g_utf8_collate_key_for_filename(ustr1, -1);
+ g_autofree char* ustr4 = g_utf8_collate_key_for_filename(ustr2, -1);
- char* ustr3 = g_utf8_collate_key_for_filename(ustr1, -1);
- char* ustr4 = g_utf8_collate_key_for_filename(ustr2, -1);
- g_free(ustr2);
- g_free(ustr1);
-
- int result = g_strcmp0(ustr3, ustr4);
- g_free(ustr4);
- g_free(ustr3);
+ return g_strcmp0(ustr3, ustr4);
+}
- return result;
+void libarchive_archive_free(void* data) {
+ if (data != NULL) {
+ archive_t* archive = data;
+ archive_read_free(archive);
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-cb-0.1.11/zathura-cb/utils.h
new/zathura-cb-2026.05.10/zathura-cb/utils.h
--- old/zathura-cb-0.1.11/zathura-cb/utils.h 2024-08-04 10:28:38.000000000
+0200
+++ new/zathura-cb-2026.05.10/zathura-cb/utils.h 2026-05-10
13:45:45.000000000 +0200
@@ -4,6 +4,7 @@
#define UTILS_H
#include <girara/macros.h>
+#include <glib.h>
/**
* Compares two paths with each other
@@ -13,6 +14,12 @@
*
* @return
*/
-GIRARA_HIDDEN int compare_path(const char* str1, const char* str2);
+int compare_path(const char* str1, const char* str2);
+
+typedef struct archive archive_t;
+
+void libarchive_archive_free(void* archive);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(archive_t, libarchive_archive_free)
#endif // UTILS_H