Closed GoogleCodeExporter closed 9 years ago
Hi Philipp,
I believe this has been fixed in revision 91. Thankfully it's only an issue
with the unit test data (if I understand correctly.)
Would you mind verifying that the tests pass correctly for you now?
Thanks,
Drew.
Original comment by drewnoakes
on 9 May 2011 at 12:16
Hi Drew,
nope, unfortunately not fixed. I have attached a path with corrections that
work for me.
Philipp
Original comment by philipp....@gmail.com
on 9 May 2011 at 12:46
Attachments:
Hi Philipp,
Unfortunately that patch causes the test to break in my locale. I was sent
another patch by Staffan which specified the time to be parsed with a " +0000"
suffix, which he says works for him, and it works in my locale too (which is
BST by the way, GMT+1, in London.)
I hope this fix works for you too!
Original comment by drewnoakes
on 9 May 2011 at 12:57
Sorry, this also does not work on my setup:
Testcase: testExtract_OriginalDateTime took 0,011 sec
Caused an ERROR
Unparseable date: "11:41:35 12 Dec 2010 +0000"
java.text.ParseException: Unparseable date: "11:41:35 12 Dec 2010 +0000"
at java.text.DateFormat.parse(DateFormat.java:337)
at com.drew.metadata.xmp.test.XmpReaderTest.testExtract_OriginalDateTime(Unknown Source)
Testcase: testExtract_DigitizedDateTime took 0,008 sec
Caused an ERROR
Unparseable date: "11:41:35 12 Dec 2010 +0000"
java.text.ParseException: Unparseable date: "11:41:35 12 Dec 2010 +0000"
at java.text.DateFormat.parse(DateFormat.java:337)
at com.drew.metadata.xmp.test.XmpReaderTest.testExtract_DigitizedDateTime(Unknown Source)
Original comment by philipp....@gmail.com
on 9 May 2011 at 1:03
[deleted comment]
THis does work for me.
Original comment by philipp....@gmail.com
on 9 May 2011 at 1:07
Attachments:
Ok, rather than trying numerous things in SVN, could you let me know which of
these assertions pass for you?
{{{
@Test
public void testExtract_OriginalDateTime() throws Exception
{
// Underlying string value (in XMP data) is: 2010-12-12T12:41:35.00+01:00, but we convert it to Date during extraction
Assert.assertEquals("Sun Dec 12 11:41:35 GMT 2010", _directory.getString(XmpDirectory.TAG_DATETIME_ORIGINAL));
Assert.assertEquals(new SimpleDateFormat("hh:mm:ss dd MM yyyy Z").parse("11:41:35 12 12 2010 +0000"), _directory.getDate(XmpDirectory.TAG_DATETIME_DIGITIZED));
Assert.assertEquals(new SimpleDateFormat("HH:mm:ss dd MMM yyyy Z").parse("12:41:35 12 Dec 2010 +0100"), _directory.getDate(XmpDirectory.TAG_DATETIME_ORIGINAL));
Calendar calendar = new GregorianCalendar(2010, 12-1, 12, 11, 41, 35);
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
Assert.assertEquals(calendar.getTime(), _directory.getDate(XmpDirectory.TAG_DATETIME_ORIGINAL));
}}}}
All four of these pass on my machine.
Original comment by drewnoakes
on 9 May 2011 at 1:33
I realised I was being stupid. I can change the timezone on my local PC and
test this myself :\
I'll get something checked in shortly. Thanks for your patience.
Original comment by drewnoakes
on 9 May 2011 at 1:43
So I tried many different timezones on my PC, and revision 93 seems to work. I
didn't change my locale preferences, though I don't know how that could effect
the outcome of these two tests in particular. I hope this is the last of it
for this issue. If you get a chance to check this again I will mark it as
verified.
Original comment by drewnoakes
on 9 May 2011 at 1:53
Revision 93 now works for me.
Original comment by philipp....@gmail.com
on 9 May 2011 at 1:58
Phew! We got there. Thanks :)
Original comment by drewnoakes
on 9 May 2011 at 2:16
Original issue reported on code.google.com by
philipp....@gmail.com
on 9 May 2011 at 11:26