Handle time zone data in EXIF.
authorSteinar H. Gunderson <sesse@debian.org>
Sat, 16 Dec 2006 15:59:14 +0000 (16:59 +0100)
committerSteinar H. Gunderson <sesse@debian.org>
Sat, 16 Dec 2006 15:59:14 +0000 (16:59 +0100)
perl/Sesse/pr0n/Common.pm

index 0b2fa2488f1df4e7e3e463e015d6db0a13a4663e..1c864fc6d8a88b07ad5b599cfa54b8389ff9671d 100644 (file)
@@ -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";
                }
        }