Fixed wrong assumption for ISO 8601 timestamp without time zone.

v0.27.3
Andreas Huggel 17 years ago
parent 528b2b11a1
commit 21c20e5ae0

@ -436,7 +436,7 @@ public:
/// ///
/// \note As compatibility "tactics" (OK, hacks), a missing date portion or missing TZD are /// \note As compatibility "tactics" (OK, hacks), a missing date portion or missing TZD are
/// tolerated. A missing date value may begin with "Thh:" or "hh:"; the year, month, and day are /// tolerated. A missing date value may begin with "Thh:" or "hh:"; the year, month, and day are
/// all set to zero in the XMP_DateTime value. A missing TZD is assumed to be UTC. /// all set to zero in the XMP_DateTime value. If TZD is missing, assume the time is in local time.
/// ///
/// \param strValue The ISO 8601 string representation of the date/time. /// \param strValue The ISO 8601 string representation of the date/time.
/// ///

@ -1262,7 +1262,7 @@ XMPUtils::ConvertToFloat ( XMP_StringPtr strValue )
// Note that ISO 8601 does not seem to allow years less than 1000 or greater than 9999. We allow // Note that ISO 8601 does not seem to allow years less than 1000 or greater than 9999. We allow
// any year, even negative ones. The year is formatted as "%.4d". // any year, even negative ones. The year is formatted as "%.4d".
// ! Tolerate missing TZD, assume is UTC. Photoshop 8 writes dates like this for exif:GPSTimeStamp. // ! Tolerate missing TZD, assume the time is in local time
// ! Tolerate missing date portion, in case someone foolishly writes a time-only value that way. // ! Tolerate missing date portion, in case someone foolishly writes a time-only value that way.
// *** Put the ISO format comments in the header documentation. // *** Put the ISO format comments in the header documentation.
@ -1396,6 +1396,10 @@ XMPUtils::ConvertToDate ( XMP_StringPtr strValue,
if ( temp > 59 ) XMP_Throw ( "Time zone minute is out of range", kXMPErr_BadParam ); if ( temp > 59 ) XMP_Throw ( "Time zone minute is out of range", kXMPErr_BadParam );
binValue->tzMinute = temp; binValue->tzMinute = temp;
} else {
XMPUtils::SetTimeZone( binValue );
} }
if ( strValue[pos] != 0 ) XMP_Throw ( "Invalid date string, extra chars at end", kXMPErr_BadParam ); if ( strValue[pos] != 0 ) XMP_Throw ( "Invalid date string, extra chars at end", kXMPErr_BadParam );

Loading…
Cancel
Save