Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some exif related problems resolved #80

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/src/*.inc /src/*.inc
/src/feh /src/feh
/man/*.1 /man/*.1
*~
2 changes: 1 addition & 1 deletion config.mk
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/exif.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ static void exif_trim_spaces(char *str)
{ {
if (*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; 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;
Expand Down Expand Up @@ -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));
} }


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


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