From f82413576837d2d9e2cb70a283a104dfbf4e08c2 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 16 Dec 2006 16:59:14 +0100 Subject: [PATCH] Handle time zone data in EXIF. --- perl/Sesse/pr0n/Common.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index 0b2fa24..1c864fc 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -182,10 +182,10 @@ sub update_width_height { # Also find the date taken if appropriate (from the EXIF tag etc.) my $info = Image::ExifTool::ImageInfo(get_disk_location($r, $id)); my $datetime = undef; - + if (defined($info->{'DateTimeOriginal'})) { # Parse the date and time over to ISO format - if ($info->{'DateTimeOriginal'} =~ /^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/ && $1 > 1990) { + if ($info->{'DateTimeOriginal'} =~ /^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)(?:\+\d\d:\d\d)?$/ && $1 > 1990) { $datetime = "$1-$2-$3 $4:$5:$6"; } } -- 2.39.2