aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.adoc3
-rw-r--r--docs/fiv.html2
-rw-r--r--fiv-browser.c13
-rw-r--r--fiv-context-menu.c11
-rw-r--r--fiv-io.c2
-rwxr-xr-xfiv-reverse-search4
-rw-r--r--fiv-view.c8
-rw-r--r--meson.build8
-rwxr-xr-xmsys2-package.sh3
9 files changed, 42 insertions, 12 deletions
diff --git a/README.adoc b/README.adoc
index 9ca9e65..46740eb 100644
--- a/README.adoc
+++ b/README.adoc
@@ -38,6 +38,9 @@ You can get a package with the latest development version using Arch Linux's
https://aur.archlinux.org/packages/fiv-git[AUR],
or as a https://git.janouch.name/p/nixexprs[Nix derivation].
+https://janouch.name/cd[Windows installers can be found here],
+you want the _x86_64_ version.
+
Building and Running
--------------------
Build-only dependencies:
diff --git a/docs/fiv.html b/docs/fiv.html
index a458882..b4a5f33 100644
--- a/docs/fiv.html
+++ b/docs/fiv.html
@@ -16,7 +16,7 @@ q:lang(en):after { content: "’"; }
<p class="details">
<span id="author">Přemysl Eric Janouch</span><br>
<span id="email"><a href="mailto:p@janouch.name">p@janouch.name</a></span><br>
-<span id="revnumber">version 0.0.0,</span>
+<span id="revnumber">version 1.0.0,</span>
<span id="revdate">2023-04-17</span>
<p class="figure"><img src="fiv.webp" alt="fiv in browser and viewer modes">
diff --git a/fiv-browser.c b/fiv-browser.c
index c9963f4..4a904f0 100644
--- a/fiv-browser.c
+++ b/fiv-browser.c
@@ -828,9 +828,18 @@ thumbnailer_next(Thumbnailer *t)
"--thumbnail", fiv_thumbnail_sizes[self->item_size].thumbnail_spec_name,
"--", uri, NULL};
+ GSubprocessLauncher *launcher =
+ g_subprocess_launcher_new(G_SUBPROCESS_FLAGS_STDOUT_PIPE);
+#ifdef G_OS_WIN32
+ gchar *prefix = g_win32_get_package_installation_directory_of_module(NULL);
+ g_subprocess_launcher_set_cwd(launcher, prefix);
+ g_free(prefix);
+#endif
+
GError *error = NULL;
- t->minion = g_subprocess_newv(t->target->icon ? argv_faster : argv_slower,
- G_SUBPROCESS_FLAGS_STDOUT_PIPE, &error);
+ t->minion = g_subprocess_launcher_spawnv(
+ launcher, t->target->icon ? argv_faster : argv_slower, &error);
+ g_object_unref(launcher);
if (error) {
g_warning("%s", error->message);
g_error_free(error);
diff --git a/fiv-context-menu.c b/fiv-context-menu.c
index 16460b6..678c616 100644
--- a/fiv-context-menu.c
+++ b/fiv-context-menu.c
@@ -185,15 +185,24 @@ info_spawn(GtkWidget *dialog, const char *path, GBytes *bytes_in)
if (bytes_in)
flags |= G_SUBPROCESS_FLAGS_STDIN_PIPE;
+ GSubprocessLauncher *launcher = g_subprocess_launcher_new(flags);
+#ifdef G_OS_WIN32
+ // Both to find wperl, and then to let wperl find the nearby exiftool.
+ gchar *prefix = g_win32_get_package_installation_directory_of_module(NULL);
+ g_subprocess_launcher_set_cwd(launcher, prefix);
+ g_free(prefix);
+#endif
+
// TODO(p): Add a fallback to internal capabilities.
// The simplest is to specify the filename and the resolution.
GError *error = NULL;
- GSubprocess *subprocess = g_subprocess_new(flags, &error,
+ GSubprocess *subprocess = g_subprocess_launcher_spawn(launcher, &error,
#ifdef G_OS_WIN32
"wperl",
#endif
"exiftool", "-tab", "-groupNames", "-duplicates", "-extractEmbedded",
"--binary", "-quiet", "--", path, NULL);
+ g_object_unref(launcher);
if (error) {
info_redirect_error(dialog, error);
return;
diff --git a/fiv-io.c b/fiv-io.c
index 24db289..2d32990 100644
--- a/fiv-io.c
+++ b/fiv-io.c
@@ -976,7 +976,7 @@ static uint32_t *
parse_mpf_index_entries(const struct tiffer *T, struct tiffer_entry *entry)
{
uint32_t count = entry->remaining_count / 16;
- uint32_t *offsets = g_malloc0_n(sizeof *offsets, count + 1), *out = offsets;
+ uint32_t *offsets = g_malloc0_n(count + 1, sizeof *offsets), *out = offsets;
for (uint32_t i = 0; i < count; i++) {
// 5.2.3.3.3. Individual Image Data Offset
uint32_t offset = parse_mpf_mpentry(entry->p + i * 16, T);
diff --git a/fiv-reverse-search b/fiv-reverse-search
index 5210703..dc12790 100755
--- a/fiv-reverse-search
+++ b/fiv-reverse-search
@@ -5,5 +5,5 @@ if [ "$#" -ne 2 ]; then
fi
xdg-open "$1$(fiv --thumbnail-for-search large "$2" \
- | curl --silent --show-error --upload-file - https://transfer.sh/image \
- | jq --slurp --raw-input --raw-output @uri)"
+ | curl --silent --show-error --form 'files[]=@-' https://uguu.se/upload \
+ | jq --raw-output '.files[] | .url | @uri')"
diff --git a/fiv-view.c b/fiv-view.c
index f0cd577..cd3cc51 100644
--- a/fiv-view.c
+++ b/fiv-view.c
@@ -851,6 +851,10 @@ gl_draw(FivView *self, cairo_t *cr)
cliph = allocation.height;
}
+ int scale = gtk_widget_get_scale_factor(GTK_WIDGET(self));
+ clipw *= scale;
+ cliph *= scale;
+
enum { SRC, DEST };
GLuint textures[2] = {};
glGenTextures(2, textures);
@@ -958,12 +962,14 @@ gl_draw(FivView *self, cairo_t *cr)
// XXX: Native GdkWindows send this to the software fallback path.
// XXX: This only reliably alpha blends when using the software fallback,
// such as with a native window, because 7237f5d in GTK+ 3 is a regression.
+ // (Introduced in 3.24.39, reverted in 3.24.42.)
+ //
// We had to resort to rendering the checkerboard pattern in the shader.
// Unfortunately, it is hard to retrieve the theme colours from CSS.
GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(self));
cairo_translate(cr, dx, dy);
gdk_cairo_draw_from_gl(
- cr, window, textures[DEST], GL_TEXTURE, 1, 0, 0, clipw, cliph);
+ cr, window, textures[DEST], GL_TEXTURE, scale, 0, 0, clipw, cliph);
gdk_gl_context_make_current(self->gl_context);
glDeleteBuffers(1, &vertex_buffer);
diff --git a/meson.build b/meson.build
index 82e7978..5f1409e 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
# vim: noet ts=4 sts=4 sw=4:
project('fiv', 'c',
default_options : ['c_std=gnu99', 'warning_level=2'],
- version : '0.1.0',
+ version : '1.0.0',
meson_version : '>=0.57')
cc = meson.get_compiler('c')
@@ -363,10 +363,12 @@ elif meson.is_cross_build()
'ProjectURL' : application_url,
}),
)
+ msi = meson.project_name() + '-' + meson.project_version() + \
+ '-' + host_machine.cpu() + '.msi'
custom_target('package',
- output : 'fiv.msi',
+ output : msi,
command : [meson.current_source_dir() / 'msys2-package.sh',
- host_machine.cpu(), 'fiv.msi', wxs],
+ host_machine.cpu(), msi, wxs],
env : ['MESON_BUILD_ROOT=' + meson.current_build_dir(),
'MESON_SOURCE_ROOT=' + meson.current_source_dir()],
console : true,
diff --git a/msys2-package.sh b/msys2-package.sh
index 27729bb..b929cbc 100755
--- a/msys2-package.sh
+++ b/msys2-package.sh
@@ -1,7 +1,8 @@
#!/bin/sh -e
export LC_ALL=C
cd "$MESON_BUILD_ROOT"
-arch=$1 msi=$2 files=package-files.wxs destdir=$(pwd)/package
+arch=$1 msi=$2 files=package-files.wxs
+destdir=$(pwd)/package/${msi%.*}
shift 2
# We're being passed host_machine.cpu(), which will be either x86 or x86_64.