diff options
author | Olof-Joachim Frahm <Olof.Frahm@web.de> | 2011-10-02 00:14:00 +0200 |
---|---|---|
committer | Olof-Joachim Frahm <Olof.Frahm@web.de> | 2011-10-02 00:14:00 +0200 |
commit | 360f6e32b8e466d9a63b319269b3fc5734cdc58e (patch) | |
tree | d4161c4ac9a19e1809b72b55ddd88088fef9bfeb /src/slideshow.c | |
parent | 0bab331e21a046a1ec775f188feadd300c9a57f8 (diff) | |
parent | f55de5185347da52e7cd282491afdc7114418e50 (diff) |
Merge remote-tracking branches 'derf/master' and 'origin/master'
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index e6ffb56..b9d9494 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -402,41 +402,38 @@ char *feh_printf(char *str, feh_file * file) strcat(ret, file->name); break; case 'w': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->width); strcat(ret, buf); } break; case 'h': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->height); strcat(ret, buf); } break; case 's': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->size); strcat(ret, buf); } break; + case 'S': + if (file && (file->info || !feh_file_info_load(file, NULL))) { + snprintf(buf, sizeof(buf), + "%.2fkB", ((double)file->info->size / 1000)); + strcat(ret, buf); + } + break; case 'p': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->pixels); strcat(ret, buf); } break; case 't': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { strcat(ret, file->info->format); } break; |