summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2016-08-06 12:22:47 +0200
committerBert Münnich <ber.t@posteo.de>2016-08-06 12:22:47 +0200
commitaabc2bddbdeecdb2651394d90b10a9290a69b527 (patch)
treec804b955cd9be7aef643da6088ce298aa7ec831d /main.c
parentf32771a6479ea028e7fc851c3a8869db95c8e05c (diff)
downloadnsxiv-aabc2bddbdeecdb2651394d90b10a9290a69b527.tar.zst
Provide image width and height to image-info script; fixes issue #159
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 00a3ffc..361477e 100644
--- a/main.c
+++ b/main.c
@@ -224,6 +224,7 @@ void open_info(void)
{
static pid_t pid;
int pfd[2];
+ char w[12], h[12];
if (info.f.err != 0 || info.open || win.bar.h == 0)
return;
@@ -239,7 +240,9 @@ void open_info(void)
if ((pid = fork()) == 0) {
close(pfd[0]);
dup2(pfd[1], 1);
- execl(info.f.cmd, info.f.cmd, files[fileidx].name, NULL);
+ snprintf(w, sizeof(w), "%d", img.w);
+ snprintf(h, sizeof(h), "%d", img.h);
+ execl(info.f.cmd, info.f.cmd, files[fileidx].name, w, h, NULL);
error(EXIT_FAILURE, errno, "exec: %s", info.f.cmd);
}
close(pfd[1]);