From b30229b770a5e9ebc4483be82bd8390d329e6d06 Mon Sep 17 00:00:00 2001 From: nova Date: Thu, 23 Jul 2026 01:10:36 +0200 Subject: [PATCH] use global_path in image previews & fit_contain --- file_previews.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/file_previews.c b/file_previews.c index 9ad9ae5..ceff0b1 100644 --- a/file_previews.c +++ b/file_previews.c @@ -12,6 +12,7 @@ static FILE *ueberzug = NULL; #endif extern unsigned int terminal_height; extern unsigned int terminal_width; +extern char *global_path; char previewd; magic_t cookie_type; magic_t cookie_description; @@ -89,17 +90,16 @@ void images_clear(){ } } void images_print(char *file_name){ - char *path=getcwd(NULL, 0); fprintf(ueberzug, "{\"action\":\"add\", \ \"identifier\":\"preview\", \ + \"scaler\":\"fit_contain\", \ \"max_height\":%d, \ \"max_width\":%d, \ \"y\":0, \ \"x\":%d, \ - \"path\":\"%s/%s\"}\n", terminal_height, terminal_width/2, terminal_width/2, path, file_name); + \"path\":\"%s/%s\"}\n", terminal_height, terminal_width/2, terminal_width/2, global_path, file_name); fflush(ueberzug); - free(path); } void ueberzug_init(){ #if SETTINGS_UEBERZUG_IMAGE_PREVIEW == 2