if ($exif)
{
$this->db()->insert('xf_mg_attachment_exif', [
'attachment_id' => $attachment->attachment_id,
'attach_date' => $attachment->attach_date,
'exif_data' => $this->em()->encodeValueForSource(\XF\Mvc\Entity\Entity::JSON, $exif)
], false, 'exif_data = VALUES(exif_data)');
}