Ymagis / ClairMeta

Clairmeta is a python package for Digital Cinema Package (DCP) probing and checking.
BSD 3-Clause "New" or "Revised" License
84 stars 22 forks source link

Clairmeta does not take TZ into account when checking creation time test. #200

Closed jamiegau closed 2 years ago

jamiegau commented 3 years ago

This is a small bug but.. Created a DCP, tested against cliarmeta stright away. Transferred to a Ubuntu box.

Error(s):
  + PKL_f893e7e3-e80f-4ccc-8313-58fecd99837d.xml (NoiseHiBRate_TST-24_F-185_51_2K_20210701_SMPTE_OV)
    . PKL Issue Date validation.
      IssueDate is post dated : 2021-07-01 10:20:47
  + CPL_f85680ab-4cb8-4a52-b327-96879dd4874a.xml (NoiseHiBRate_TST-24_F-185_51_2K_20210701_SMPTE_OV)
    . CPL Issue Date validation.
      IssueDate is post dated : 2021-07-01 10:20:47
    + VIDEO_923bb55e-b6e5-4faa-8e67-ea32297fe358.mxf
      . Picture maximum bitrate DCI compliance.
        Exceed DCI maximum bitrate (250.05 Mb/s) : 275.81 Mb/s

Set the Linux box the the right time zone as I am in.. (It was UTC default) Error goes away when running the command.

This issue will only occur under the right circumstances within 24 hours of creation of the DCP.

remia commented 2 years ago

Thanks for the report @jamiegau, after reviewing the issue I think the code for date comparison was just simply wrong. We were just replacing the timezone of 'now' with the one from the DCP IssueDate but without any conversion (using datetime.replace(tzinfo=...) instead of datetime.astimezone()).

This should be solved in #207