Skip Menu |

This queue is for tickets about the Image-ExifTool CPAN distribution.

Report information
The Basics
Id: 120762
Status: resolved
Priority: 0/
Queue: Image-ExifTool

People
Owner: Nobody in particular
Requestors: guillaume [...] atto.be
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: exiftool outputs wrong date format with some PDFs
Date: Sun, 26 Mar 2017 11:34:52 +0200
To: bug-Image-ExifTool [...] rt.cpan.org
From: Guillaume <guillaume [...] atto.be>
Hi, With some specific PDF (an invoice from a utility company), exiftool output the CreateData information with an incorrect format, which doesn't match format specified using option -d I cannot include the PDF in this public bug tracker as it contains private information, could you please: * Give some instruction to scrap the PDF content while preserving metadata, so that I may share it with you? * Or if you are exiftool developer, provide your contact so that I may share the PDF privately. Reproducing: exiftool -s3 -CreateDate -d %Y-%m-%d 102038984-111001311801.pdf Actual result: 5/9/2016 13:57:21 Expected result: 2016-09-05 Software versions: libimage-exiftool-perl 10.40-1 perl 5.24.1 Linux 4.9.0-2-amd64 Debian GNU/Linux testing repository -- Jabber : guillaume@atto.be PGP : 2054C46F0019B937
Unfortunately the format for some PDF date/time tags is not specified. For these, ExifTool doesn't attempt to do a conversion. I don't see any reasonable way around this.
Subject: Re: [rt.cpan.org #120762] exiftool outputs wrong date format with some PDFs
Date: Sun, 26 Mar 2017 20:46:44 +0200
To: bug-Image-ExifTool [...] rt.cpan.org
From: Guillaume <guillaume [...] atto.be>
Le 26/03/2017 à 17:21, Phil Harvey via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120762 > > > Unfortunately the format for some PDF date/time tags is not specified. For these, ExifTool doesn't attempt to do a conversion. I don't see any reasonable way around this. >
Thanks for the feedback. It make sense that ExifTool wouldn't convert the date format if the source format is unknown. Consider doing a hard-failure when ExifTool encounters such a PDF and option -d is specified. It would be better than silently failing and returning an incorrect output, because it currently appears as if everything went fine: exiftool -s3 -CreateDate -d %Y-%m-%d my.pdf && echo okay 5/9/2016 13:57:21 okay imho, if ExifTool fails to process some parameters (such as -d), then it should exit with a non-zero return value, and if possible print a relevant error message. Regards, Guillaume -- PGP : 2054C46F0019B937
Thanks for the feedback, but failing as you suggest is far too extreme (a large percentage of ExifTool commands would then fail). I see your point though. I would think that just failing to return the value would be better, but there are complications there too (ie. if another same-named tag exists then you would probably want to use that value but this would be tricky to do). I'll think about this. - Phil
I should have remembered this earlier: Have you tried the "StrictDate" API option (ie. "-api strictdate" on the command line)? I think this may do exactly what you want. - Phil
Subject: Re: [rt.cpan.org #120762] exiftool outputs wrong date format with some PDFs
Date: Fri, 7 Apr 2017 19:29:17 +0200
To: bug-Image-ExifTool [...] rt.cpan.org
From: Guillaume <guillaume [...] atto.be>
Le 01/04/2017 à 13:52, Phil Harvey via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=120762 > > > I should have remembered this earlier: Have you tried the "StrictDate" API option (ie. "-api strictdate" on the command line)? I think this may do exactly what you want. > > - Phil >
Option "-api strictdate" works beautifully, thanks. With most PDF this still provides the expected output. With the offending PDF (from the utility company), there now an empty output, which make sense in a strict more. Guillaume -- Jabber : guillaume@atto.be PGP : 2054C46F0019B937