replace file::getExtension() by pahtinfo()