--- parser3/src/classes/image.C 2003/12/02 11:55:46 1.103 +++ parser3/src/classes/image.C 2004/02/19 15:25:10 1.106 @@ -1,11 +1,11 @@ /** @file Parser: @b image parser class. - Copyright(c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright(c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_IMAGE_C="$Date: 2003/12/02 11:55:46 $"; +static const char * const IDENT_IMAGE_C="$Date: 2004/02/19 15:25:10 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -178,7 +178,7 @@ public: if(ssize_t(read_size)<0 || read_size>limit) throw Exception(0, &file_name, - "measure failed: actually read %lu bytes count not in [0..%lu] valid range", + "measure failed: actually read %u bytes count not in [0..%u] valid range", read_size, limit); return read_size; @@ -392,7 +392,7 @@ static Value* parse_IFD_entry_formatted_ } // date.C -time_t cstr_to_time_t(char *cstr, bool fail_on_error); +time_t cstr_to_time_t(char *cstr); static Value* parse_IFD_entry_formatted_value(bool is_big, ushort format, size_t component_size, uint components_count, @@ -407,10 +407,10 @@ static Value* parse_IFD_entry_formatted_ char cstr_writable[JPEG_EXIF_DATE_CHARS]; strcpy(cstr_writable, cstr); - time_t t=cstr_to_time_t(cstr_writable, - false/* do not throw exception, just return bad result */); - if(t>=0) - return new VDate(t); + try { + return new VDate(cstr_to_time_t(cstr_writable)); + } + catch(...) { /*ignore bad date times*/ } } if(const char* premature_zero_pos=(const char* )memchr(cstr, 0, length))