Skip to content

Commit

Permalink
- improved handling of images which have exif tags but not ours
Browse files Browse the repository at this point in the history
- fixed uninitialzed pointer in thumbnail mode
- added nikon lens info if available
  • Loading branch information
reald committed Feb 5, 2012
1 parent 0d7602f commit 132ecc0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@
/src/*.inc
/src/feh
/man/*.1
*~
2 changes: 1 addition & 1 deletion config.mk
Expand Up @@ -21,7 +21,7 @@ curl ?= 1
debug ?= 0
help ?= 0
xinerama ?= 1
exif ?= 0
exif ?= 1

ifeq (${curl},1)
CFLAGS += -DHAVE_LIBCURL
Expand Down
8 changes: 5 additions & 3 deletions src/exif.c
Expand Up @@ -45,10 +45,10 @@ static void exif_trim_spaces(char *str)
{
if (*str != ' ')
{
end = str;
end = str+1;
}
}
*++end = '\0';
*end = '\0';
}


Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}

}
Expand Down
5 changes: 4 additions & 1 deletion src/filelist.c
Expand Up @@ -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);
}

Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/imlib.c
Expand Up @@ -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);
Expand Down

0 comments on commit 132ecc0

Please sign in to comment.