diff --git a/.gitignore b/.gitignore index dd0b5623424d21c51300efaae8d1867075950bfc..559c5abb65f712461457f8f2d91642e93792cbed 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /src/*.inc /src/feh /man/*.1 +*~ \ No newline at end of file diff --git a/src/exif.c b/src/exif.c index 02154e45bdf81436971cd31554037bd1d6417cfe..9d26072b6508fbfb9bb4c22b79aa9f21ce98f29d 100644 --- a/src/exif.c +++ b/src/exif.c @@ -45,10 +45,10 @@ static void exif_trim_spaces(char *str) { if (*str != ' ') { - end = str; + end = str+1; } } - *++end = '\0'; + *end = '\0'; } @@ -146,7 +146,7 @@ void exif_get_info(ExifData * ed, char *buffer, unsigned int maxsize) { return; } - else if (ed == NULL ) + else if (ed == NULL) { snprintf(buffer, (size_t)maxsize, "%s\n", "No Exif data in file."); return; @@ -187,6 +187,8 @@ void exif_get_info(ExifData * ed, char *buffer, unsigned int maxsize) { /* Digital Vari-Program */ exif_get_mnote_tag(ed, 171, buffer + strlen(buffer), maxsize - strlen(buffer)); + /* Lens */ + exif_get_mnote_tag(ed, 132, buffer + strlen(buffer), maxsize - strlen(buffer)); } } diff --git a/src/filelist.c b/src/filelist.c index 32bc2a5836c550304f9f2c3fafd70e382975642d..9756c27b6eb6c6902444d30539249c5be46c6d30 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -54,6 +54,9 @@ feh_file *feh_file_new(char *filename) else newfile->name = estrdup(filename); newfile->info = NULL; +#ifdef HAVE_LIBEXIF + newfile->ed = NULL; +#endif return(newfile); } @@ -70,7 +73,7 @@ void feh_file_free(feh_file * file) if (file->info) feh_file_info_free(file->info); #ifdef HAVE_LIBEXIF - if (file->info) + if (file->ed) exif_data_unref(file->ed); #endif free(file); diff --git a/src/imlib.c b/src/imlib.c index 0b60180be5d5c0e1747f62991c1a4e361244fb05..197b8f57122096fce4ad90473672ce2f7ba68bc5 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -522,6 +522,8 @@ void feh_draw_exif(winwidget w) return; } + + buffer[0] = '\0'; exif_get_info(FEH_FILE(w->file->data)->ed, buffer, MAX_EXIF_DATA); fn = feh_load_font(w);