use global_path in image previews & fit_contain

This commit is contained in:
nova
2026-07-23 01:10:36 +02:00
parent f7589dbe2b
commit b30229b770
+3 -3
View File
@@ -12,6 +12,7 @@ static FILE *ueberzug = NULL;
#endif #endif
extern unsigned int terminal_height; extern unsigned int terminal_height;
extern unsigned int terminal_width; extern unsigned int terminal_width;
extern char *global_path;
char previewd; char previewd;
magic_t cookie_type; magic_t cookie_type;
magic_t cookie_description; magic_t cookie_description;
@@ -89,17 +90,16 @@ void images_clear(){
} }
} }
void images_print(char *file_name){ void images_print(char *file_name){
char *path=getcwd(NULL, 0);
fprintf(ueberzug, "{\"action\":\"add\", \ fprintf(ueberzug, "{\"action\":\"add\", \
\"identifier\":\"preview\", \ \"identifier\":\"preview\", \
\"scaler\":\"fit_contain\", \
\"max_height\":%d, \ \"max_height\":%d, \
\"max_width\":%d, \ \"max_width\":%d, \
\"y\":0, \ \"y\":0, \
\"x\":%d, \ \"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); fflush(ueberzug);
free(path);
} }
void ueberzug_init(){ void ueberzug_init(){
#if SETTINGS_UEBERZUG_IMAGE_PREVIEW == 2 #if SETTINGS_UEBERZUG_IMAGE_PREVIEW == 2