Subject: | Not enough arguments for Time::Piece::_strptime error |
Hi. According to the Changes, Image::ExifTool has been supporting Time::Piece since 10.32, but it spits an error "Not enough arguments for Time::Piece::_strptime" if Time::Piece is actually loaded (when POSIX::strftime is not available), because of the difference of the number of subroutine arguments.
To reproduce the issue, add "use Time::Piece;" at the beginning of t/Writer.t and run it under an environment without POSIX::strftime.
To fix this, replace Time::Piece::_strftime(...) in lib/Image/ExifTool/Writer.pl with Time::Piece->strftime(...), as the following patch.
--- a/lib/Image/ExifTool/Writer.pl
+++ b/lib/Image/ExifTool/Writer.pl
@@ -4334,7 +4334,7 @@ sub InverseDateTime($$;$$)
if ($hasStrptime == 1) {
@a = POSIX::strptime($val, $fmt);
} else {
- @a = Time::Piece::_strptime($val, $fmt);
+ @a = Time::Piece->strptime($val, $fmt);
}
if (defined $a[5] and length $a[5]) {
$a[5] += 1900; # add 1900 to year
Cheers