Skip to content
Snippets Groups Projects
Commit 132ecc0f authored by Dennis Real's avatar Dennis Real
Browse files

- improved handling of images which have exif tags but not ours

- fixed uninitialzed pointer in thumbnail mode
- added nikon lens info if available
parent 0d7602ff
No related branches found
No related tags found
No related merge requests found
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
/src/*.inc /src/*.inc
/src/feh /src/feh
/man/*.1 /man/*.1
*~
\ No newline at end of file
...@@ -21,7 +21,7 @@ curl ?= 1 ...@@ -21,7 +21,7 @@ curl ?= 1
debug ?= 0 debug ?= 0
help ?= 0 help ?= 0
xinerama ?= 1 xinerama ?= 1
exif ?= 0 exif ?= 1
ifeq (${curl},1) ifeq (${curl},1)
CFLAGS += -DHAVE_LIBCURL CFLAGS += -DHAVE_LIBCURL
......
...@@ -45,10 +45,10 @@ static void exif_trim_spaces(char *str) ...@@ -45,10 +45,10 @@ static void exif_trim_spaces(char *str)
{ {
if (*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) ...@@ -146,7 +146,7 @@ void exif_get_info(ExifData * ed, char *buffer, unsigned int maxsize)
{ {
return; return;
} }
else if (ed == NULL ) else if (ed == NULL)
{ {
snprintf(buffer, (size_t)maxsize, "%s\n", "No Exif data in file."); snprintf(buffer, (size_t)maxsize, "%s\n", "No Exif data in file.");
return; return;
...@@ -187,6 +187,8 @@ void exif_get_info(ExifData * ed, char *buffer, unsigned int maxsize) ...@@ -187,6 +187,8 @@ void exif_get_info(ExifData * ed, char *buffer, unsigned int maxsize)
{ {
/* Digital Vari-Program */ /* Digital Vari-Program */
exif_get_mnote_tag(ed, 171, buffer + strlen(buffer), maxsize - strlen(buffer)); 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));
} }
} }
......
...@@ -54,6 +54,9 @@ feh_file *feh_file_new(char *filename) ...@@ -54,6 +54,9 @@ feh_file *feh_file_new(char *filename)
else else
newfile->name = estrdup(filename); newfile->name = estrdup(filename);
newfile->info = NULL; newfile->info = NULL;
#ifdef HAVE_LIBEXIF
newfile->ed = NULL;
#endif
return(newfile); return(newfile);
} }
...@@ -70,7 +73,7 @@ void feh_file_free(feh_file * file) ...@@ -70,7 +73,7 @@ void feh_file_free(feh_file * file)
if (file->info) if (file->info)
feh_file_info_free(file->info); feh_file_info_free(file->info);
#ifdef HAVE_LIBEXIF #ifdef HAVE_LIBEXIF
if (file->info) if (file->ed)
exif_data_unref(file->ed); exif_data_unref(file->ed);
#endif #endif
free(file); free(file);
......
...@@ -522,6 +522,8 @@ void feh_draw_exif(winwidget w) ...@@ -522,6 +522,8 @@ void feh_draw_exif(winwidget w)
return; return;
} }
buffer[0] = '\0';
exif_get_info(FEH_FILE(w->file->data)->ed, buffer, MAX_EXIF_DATA); exif_get_info(FEH_FILE(w->file->data)->ed, buffer, MAX_EXIF_DATA);
fn = feh_load_font(w); fn = feh_load_font(w);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment