Oh yeah, thanks, I was using this bits of code from 2018 that was made for kirby 2. Haha.
here is the completly updated hook if needed:
'hooks' => [
'file.create:after' => function ($file)
if ($file->type() == 'image') {
// Get date created from exif data
$datecreated = $file->exif()->timestamp();
// Get keywords via function
function iptc_keywords($file)
{
getimagesize($file->root(), $info);
if (isset($info['APP13'])) {
$iptc = iptcparse($info['APP13']);
// Get keywords
$keywords = '';
$keywordcount = count($iptc["2#025"]);
for ($i = 0; $i < $keywordcount; $i++) {
$keywords .= $iptc['2#025'][$i] . ', ';
}
$keywords = rtrim($keywords, ', ');
return $keywords;
}
};
$keywords = iptc_keywords($file);
// Update image metadata
$file->update(array(
'date' => $datecreated,
'tags' => $keywords
));
}
}
],