From 478e4b6bc81f6f532db2f9d0f8030152913bb3dd Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 29 Mar 2008 09:52:48 +0100 Subject: [PATCH] PhotoRec: for JPEG files, fix conversion from time/date store in Exif header to Unix time --- src/file_jpg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/file_jpg.c b/src/file_jpg.c index 430c23ee..411d2308 100644 --- a/src/file_jpg.c +++ b/src/file_jpg.c @@ -181,11 +181,11 @@ static time_t get_date_from_tiff_header(const struct tiff_entry *tiff, const uns if(date_asc==NULL) return (time_t)0; memset(&tm_time, 0, sizeof(tm_time)); - tm_time.tm_sec=(date_asc[17]-'0')*10+(date_asc[18]-'0'); /* seconds */ - tm_time.tm_min=(date_asc[14]-'0')*10+(date_asc[15]-'0'); /* minutes */ - tm_time.tm_hour=(date_asc[11]-'0')*10+(date_asc[12]-'0'); /* hours */ - tm_time.tm_mday=(date_asc[8]-'0')*10+(date_asc[9]-'0'); /* day of the month */ - tm_time.tm_mon=(date_asc[5]-'0')*10+(date_asc[6]-'0'); /* month */ + tm_time.tm_sec=(date_asc[17]-'0')*10+(date_asc[18]-'0'); /* seconds 0-59 */ + tm_time.tm_min=(date_asc[14]-'0')*10+(date_asc[15]-'0'); /* minutes 0-59 */ + tm_time.tm_hour=(date_asc[11]-'0')*10+(date_asc[12]-'0'); /* hours 0-23*/ + tm_time.tm_mday=(date_asc[8]-'0')*10+(date_asc[9]-'0'); /* day of the month 1-31 */ + tm_time.tm_mon=(date_asc[5]-'0')*10+(date_asc[6]-'0')-1; /* month 0-11 */ tm_time.tm_year=(date_asc[0]-'0')*1000+(date_asc[1]-'0')*100+ (date_asc[2]-'0')*10+(date_asc[3]-'0')-1900; /* year */ tm_time.tm_isdst=-1; /* unknown daylight saving time */