Skip to content

CreateDate tag date format #66

@nikolanedic

Description

@nikolanedic

I'm using your script with Exiftool adapter and I'm getting a fatal error in PHPExif\Exif.php on line 698 (public function setCreationDate(\DateTime $value)) since bool is passed to a function and it's type-hinted to receive a DateTime object, but I'm getting this error only for some images. I dig around a bit and I realized that some images had date format of 'Y:m:d H:i:s' and others had 'Y:m:d H:i:sP'. I fixed it by extending a mapper (PHPExif\Mapper\Exiftool) class and skipped CreateDate key if a value is not an instance of DateTime, but maybe it should parse that date regardless of format since it's readable by exiftool so I assume it is a valid value for that tag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions