GNOME Bugzilla – Bug 526727
Parsing dates in extractors
Last modified: 2008-04-07 20:09:17 UTC
Please describe the problem: In some random cases, the Image:Date metadata is missing using tracker-extract with a jpeg. Steps to reproduce: 1. Choose a fotograph with XMP and/or EXIF metadata 2. tracker-extract /home/xxx/yyy/zzzz/file.jpeg image/jpeg 3. Check the output for an Image:Date Actual results: The Image:Date metadata is in the output only some times. Expected results: Image:Date must be present every time, because the image file contains the metadata. Does this happen every time? No, run it some times to check the result. Try with different images. Other information: It is caused by an uninitialized array in tracker-extract.c - tracker_generic_date_extractor(): timezone_buffer[6] can be used in g_strconcat without initialization, with undefined content. I will attach a patch that solves this bug and simplify the code, replacing the current hand-made date parsing functions with strptime and strftime C standard library functions.
Created attachment 108784 [details] [review] Uses strptime strftime to convert dates to iso8601 1) The iso standard for date and time is ISO 8601 (and not 8160 as the code said). This patch rename all iso8160 to iso8601. 2) Replaced the old and complex code with strftime and strptime functions. These functions return a NULL terminated string, and the result has as maximum 25 characters (24 + '\0')
Committed.